From nobody Sun May 10 06:03:31 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 174A8944E for ; Tue, 31 Dec 2024 11:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735645540; cv=none; b=QAt8TlOMYdCLIvxeDK0V3Vkvk0dsjCHvOxO+JU/zW60qmI3EGfAs0NlO6kLmS1NYSMil0QyMyIEWVpUdlvbyOmlkAZIGAr2K6almnGXEIIXG6uOzyazRoiq59c6Qu4Gs7xnERWVzXPs8oeTyMB4LWy6rjtHqeC7FIqjlW98ZLTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735645540; c=relaxed/simple; bh=KbCG4W62sxS8c0nKRaGE26K2bsjDKk2SYmqdtRr3rbg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=W9St3qbiAfD70OM2Xl4DU2CiMZf8vRelX5A2GhLOT5RlTrwN5J/GIjclBgk7HmIKbVrA8VY79jBuSi5FuwxAdbijz9YKeKZ7K4DjKgqfCCLTgZxnoLupNUuBbd0HVUy2s4FGE1ioxJ/K+nh0TasEAQ2gufwQghHV7WWEJ1OeZ78= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OrsurHFn; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OrsurHFn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1735645536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SaUM8anQHJEebN3v7sDN1GGuFLjgIRayHtbBjV0JEOk=; b=OrsurHFnJKek66K17BFnYWgO47+bRpyVM3IPyuIIc/3E2Wa7PR+NK5D1w9Clw9n2rFSS1P IUZy8sKpVZV7vdkGEc3NdAgmgX42Va67mIJH0abUaUMNUgHJyNJH024T81+nj3C+KejVzd hIsacxNCUQp7F/cb0RgZfK5WIjj8T1w= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-RyXzNvgmMWOHYLKVHs8UEA-1; Tue, 31 Dec 2024 06:45:32 -0500 X-MC-Unique: RyXzNvgmMWOHYLKVHs8UEA-1 X-Mimecast-MFC-AGG-ID: RyXzNvgmMWOHYLKVHs8UEA Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4361f371908so70595305e9.0 for ; Tue, 31 Dec 2024 03:45:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735645530; x=1736250330; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SaUM8anQHJEebN3v7sDN1GGuFLjgIRayHtbBjV0JEOk=; b=I02tsYjb+NsEa/9AWUnZodoEXrci7L6e3Mg1jsPL1blv/F99l2aM4+XQp66YvRf1yQ 2CwUulM8U7bto73O08Db03wPm5xmwe9Pfoh4271IDgmaHFIdNOz0biP1tYwJNxqhs+Hx 3p/wuLoivwPysbe1vIkoX55jS4aKth9bbuRViZXlH5ugtgMyyKNAMwT0vGes9zO1IEq5 2TV6d2N9zvM+mAEGZ9aDpkFifJjz7IaXCHa/5Hxx//nbi8lWQ9bbJFHWMp7cAh2ERV3K kCok77ZuzGP5JxrZx+xhwWp5q8leHH4vq87E7Z5yknoyreqCT3FNv3163K9Vfz43RyMy sXPA== X-Gm-Message-State: AOJu0Yy6XZz/rkzKL0ps1BqcZw3AiejV51wjjl/X3+Lf2nPcrn0Vcxzl sTzMwLpuExROqPFwC92uZxaMFXJ6i3+u39xC1t1XHPdmBDvNvGY+lziWhYoTNZjM/YB9hxCs1fm tiCWv1CsguhtS+zkquI1TLa6goV5ZGzYXsBSTz+ybDui1Cx9ghnmmQT4wMGofWP+x72I7Ia0pgi sA7b2My4/xy9yv3pkh/dZ+YV4/9qQSn01PBFAMROYtrYX3 X-Gm-Gg: ASbGncusL5lah4n6V7mXDpQHyPkeitNqVsl4uaHG9AzcM2gaSrVLsslyDtOoRvS1/Pk kYwqtdUUqcNlH/RcTsQTErm9ceWTRv11vNmUuYQazSY0nQyLq44zyqre0NeD9/YmN6VwsHIGGMX WZ8+VSHYrKW8PBpAnCH357QtKvhKy9ZQgKALRr5VqcXpUylghf6E1Oc9DNkqHmnf+l5f3we2iQ5 bYXYoFeJ0Y1/sRGHftp0majQYuyjPNBfi+fXRchfLq66GeLcNLYtCC/mtVbxbga+i06Drl+e62j 8618RQ== X-Received: by 2002:a05:600c:3ca4:b0:436:6460:e680 with SMTP id 5b1f17b1804b1-43668646b20mr343878545e9.16.1735645530402; Tue, 31 Dec 2024 03:45:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4dB4nSgsL3IVAP4OZxA2dZtA2jibQtzQsdMVBXkuz+8i2GFB2rBmneZcS22MdY4Mmt76ESA== X-Received: by 2002:a05:600c:3ca4:b0:436:6460:e680 with SMTP id 5b1f17b1804b1-43668646b20mr343878305e9.16.1735645530009; Tue, 31 Dec 2024 03:45:30 -0800 (PST) Received: from localhost (62-151-111-63.jazzfree.ya.com. [62.151.111.63]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661219a7csm383876635e9.24.2024.12.31.03.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Dec 2024 03:45:29 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Mark Brown , Javier Martinez Canillas , David Airlie , Maarten Lankhorst , Maxime Ripard , Simona Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ssd130x: Set SPI .id_table to prevent an SPI core warning Date: Tue, 31 Dec 2024 12:44:58 +0100 Message-ID: <20241231114516.2063201-1-javierm@redhat.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The only reason for the ssd130x-spi driver to have an spi_device_id table is that the SPI core always reports an "spi:" MODALIAS, even when the SPI device has been registered via a Device Tree Blob. Without spi_device_id table information in the module's metadata, module autoloading would not work because there won't be an alias that matches the MODALIAS reported by the SPI core. This spi_device_id table is not needed for device matching though, since the of_device_id table is always used in this case. For this reason, the struct spi_driver .id_table field is currently not set in the SPI driver. Because the spi_device_id table is always required for module autoloading, the SPI core checks during driver registration that both an of_device_id table and a spi_device_id table are present and that they contain the same entries for all the SPI devices. Not setting the .id_table field in the driver then confuses the core and leads to the following warning when the ssd130x-spi driver is registered: [ 41.091198] SPI driver ssd130x-spi has no spi_device_id for sinowealth= ,sh1106 [ 41.098614] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1305 [ 41.105862] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1306 [ 41.113062] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1307 [ 41.120247] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1309 [ 41.127449] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1322 [ 41.134627] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1325 [ 41.141784] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1327 [ 41.149021] SPI driver ssd130x-spi has no spi_device_id for solomon,ss= d1331 To prevent the warning, set the .id_table even though it's not necessary. Since the check is done even for built-in drivers, drop the condition to only define the ID table when the driver is built as a module. Finally, rename the variable to use the "_spi_id" convention used for ID tables. Signed-off-by: Javier Martinez Canillas Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/solomon/ssd130x-spi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/solomon/ssd130x-spi.c b/drivers/gpu/drm/solomo= n/ssd130x-spi.c index 08334be38694..7c935870f7d2 100644 --- a/drivers/gpu/drm/solomon/ssd130x-spi.c +++ b/drivers/gpu/drm/solomon/ssd130x-spi.c @@ -151,7 +151,6 @@ static const struct of_device_id ssd130x_of_match[] =3D= { }; MODULE_DEVICE_TABLE(of, ssd130x_of_match); =20 -#if IS_MODULE(CONFIG_DRM_SSD130X_SPI) /* * The SPI core always reports a MODALIAS uevent of the form "spi:", = even * if the device was registered via OF. This means that the module will no= t be @@ -160,7 +159,7 @@ MODULE_DEVICE_TABLE(of, ssd130x_of_match); * To workaround this issue, add a SPI device ID table. Even when this sho= uld * not be needed for this driver to match the registered SPI devices. */ -static const struct spi_device_id ssd130x_spi_table[] =3D { +static const struct spi_device_id ssd130x_spi_id[] =3D { /* ssd130x family */ { "sh1106", SH1106_ID }, { "ssd1305", SSD1305_ID }, @@ -175,14 +174,14 @@ static const struct spi_device_id ssd130x_spi_table[]= =3D { { "ssd1331", SSD1331_ID }, { /* sentinel */ } }; -MODULE_DEVICE_TABLE(spi, ssd130x_spi_table); -#endif +MODULE_DEVICE_TABLE(spi, ssd130x_spi_id); =20 static struct spi_driver ssd130x_spi_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .of_match_table =3D ssd130x_of_match, }, + .id_table =3D ssd130x_spi_id, .probe =3D ssd130x_spi_probe, .remove =3D ssd130x_spi_remove, .shutdown =3D ssd130x_spi_shutdown, --=20 2.47.1