]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
driver core: platform: Include header for struct platform_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 30 Jun 2026 09:24:23 +0000 (11:24 +0200)
committerUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Fri, 3 Jul 2026 05:38:14 +0000 (07:38 +0200)
Platform drivers can define an array containing the supported device
variants to be assigned to the struct platform_driver's .id_table.

While a forward declaration of struct platform_device_id is technically
enough to make the driver self-contained, it's reasonable to provide the
(very lightweight) data type definition for that array in
<linux/platform_device.h> to not add that burden to all platform drivers
with an id-table.

Note that currently <linux/device.h> transitively includes
<linux/mod_devicetable.h> that provides struct platform_device_id. But
that include is planned to be replaced by a tighter set of includes that
only define the structures relevant for the stuff in <linux/device.h>.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/4ca29592c9d1c6d528a65e05b80af7355f3c79c5.1782808461.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
include/linux/platform_device.h

index 26e6a43358e25cce2e2c38245dc0f0fc43923bf5..8c566f09d04efe420d85ffa046f92c44c6d08526 100644 (file)
@@ -11,6 +11,7 @@
 #define _PLATFORM_DEVICE_H_
 
 #include <linux/device.h>
+#include <linux/device-id/platform.h>
 
 #define PLATFORM_DEVID_NONE    (-1)
 #define PLATFORM_DEVID_AUTO    (-2)
@@ -18,7 +19,6 @@
 struct irq_affinity;
 struct mfd_cell;
 struct property_entry;
-struct platform_device_id;
 
 struct platform_device {
        const char      *name;