From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Arnd Bergmann <arnd@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Hans de Goede <hansg@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] driver core: platform: add kerneldoc to struct platform_device_info
Date: Fri, 13 Feb 2026 18:52:43 -0800 [thread overview]
Message-ID: <20260214025246.2095239-2-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20260214025246.2095239-1-dmitry.torokhov@gmail.com>
Add kernel documentation for struct platform_device_info and its
individual members. While at it remove an extra indent level from the
structure definition.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
include/linux/platform_device.h | 53 ++++++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 11 deletions(-)
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 813da101b5bf..5f54217930e1 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -118,22 +118,53 @@ extern int platform_get_irq_byname_optional(struct platform_device *dev,
const char *name);
extern int platform_add_devices(struct platform_device **, int);
+/**
+ * struct platform_device_info - set of parameters for creating a platform device
+ * @parent: parent device for the new platform device.
+ * @fwnode: firmware node associated with the device.
+ * @of_node_reused: indicates that device tree node associated with the device
+ * is shared with another device, typically its ancestor. Setting this to
+ * %true prevents the device from being matched via the OF match table,
+ * and stops the device core from automatically binding pinctrl
+ * configuration to avoid disrupting the other device.
+ * @name: name of the device.
+ * @id: instance ID of the device. Use %PLATFORM_DEVID_NONE if there is only
+ * one instance of the device, or %PLATFORM_DEVID_AUTO to let the
+ * kernel automatically assign a unique instance ID.
+ * @res: set of resources to attach to the device.
+ * @num_res: number of entries in @res.
+ * @data: device-specific data for this platform device.
+ * @size_data: size of device-specific data.
+ * @dma_mask: DMA mask for the device.
+ * @properties: a set of software properties for the device. If provided,
+ * a managed software node will be automatically created and
+ * assigned to the device. The properties array must be terminated
+ * with a sentinel entry.
+ *
+ * This structure is used to hold information needed to create and register
+ * a platform device using platform_device_register_full().
+ *
+ * platform_device_register_full() makes deep copies of @name, @res, @data and
+ * @properties, so the caller does not need to keep them after registration.
+ * If the registration is performed during initialization, these can be marked
+ * as __initconst.
+ */
struct platform_device_info {
- struct device *parent;
- struct fwnode_handle *fwnode;
- bool of_node_reused;
+ struct device *parent;
+ struct fwnode_handle *fwnode;
+ bool of_node_reused;
- const char *name;
- int id;
+ const char *name;
+ int id;
- const struct resource *res;
- unsigned int num_res;
+ const struct resource *res;
+ unsigned int num_res;
- const void *data;
- size_t size_data;
- u64 dma_mask;
+ const void *data;
+ size_t size_data;
+ u64 dma_mask;
- const struct property_entry *properties;
+ const struct property_entry *properties;
};
extern struct platform_device *platform_device_register_full(
const struct platform_device_info *pdevinfo);
--
2.53.0.310.g728cabbaf7-goog
next prev parent reply other threads:[~2026-02-14 2:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-14 2:52 [PATCH v2 0/3] Allow attaching software node when registering platform devices Dmitry Torokhov
2026-02-14 2:52 ` Dmitry Torokhov [this message]
2026-02-16 13:31 ` [PATCH v2 1/3] driver core: platform: add kerneldoc to struct platform_device_info Bartosz Golaszewski
2026-02-14 2:52 ` [PATCH v2 2/3] driver core: platform: allow attaching software nodes when creating devices Dmitry Torokhov
2026-02-16 13:31 ` Bartosz Golaszewski
2026-02-14 2:52 ` [PATCH v2 3/3] driver core: platform: fix various formatting issues Dmitry Torokhov
2026-02-16 13:31 ` Bartosz Golaszewski
2026-02-14 10:55 ` [PATCH v2 0/3] Allow attaching software node when registering platform devices Danilo Krummrich
2026-03-01 5:02 ` Dmitry Torokhov
2026-03-02 0:42 ` Danilo Krummrich
2026-03-02 14:39 ` Danilo Krummrich
2026-03-03 15:55 ` Dmitry Torokhov
2026-03-03 16:45 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260214025246.2095239-2-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=arnd@kernel.org \
--cc=brgl@kernel.org \
--cc=dakr@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox