Skip to contentSkip to conversation

driver core: remove incorrect comment for device_create*

PATCH In review Greg Kroah-Hartman 2 participants 2 messages Apr 2, 2023 – Apr 3, 2023 Driver core

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 driver core: remove incorrect comment for device_create*

The device_create() and device_create_with_groups() function comments incorrectly state that they only work with a struct class that was created using class_create(), but that is not true now and I am not sure if it ever was. So just remove the comment as it's not needed now.

Cc "Rafael J. Wysocki" <[email protected]>
---
 drivers/base/core.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/base/core.c +0 -6
index 3ee5d206e7eb..7a42d1b6b721 100644
@@ -4330,9 +4330,6 @@ device_create_groups_vargs(const struct class *class, struct device *parent,
  * pointer.
  *
  * Returns &struct device pointer on success, or ERR_PTR() on error.
- *
- * Note: the struct class passed to this function must have previously
- * been created with a call to class_create().
  */
 struct device *device_create(const struct class *class, struct device *parent,
 			     dev_t devt, void *drvdata, const char *fmt, ...)
@@ -4371,9 +4368,6 @@ EXPORT_SYMBOL_GPL(device_create);
  * pointer.
  *
  * Returns &struct device pointer on success, or ERR_PTR() on error.
- *
- * Note: the struct class passed to this function must have previously
- * been created with a call to class_create().
  */
 struct device *device_create_with_groups(const struct class *class,
 					 struct device *parent, dev_t devt,
Signature · 1 line
2.40.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Greg Kroah-Hartman

The device_create() and device_create_with_groups() function comments incorrectly state that they only work with a struct class that was created using class_create(), but that is not true now and I am not sure if it ever was. So just remove the comment as it's not needed now.

Cc "Rafael J. Wysocki" <[email protected]>
Quoted 31 lines
---
 drivers/base/core.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/base/core.c +0 -7
index 3ee5d206e7eb..7a42d1b6b721 100644
@@ -4330,9 +4330,6 @@ device_create_groups_vargs(const struct class *class, struct device *parent,
  * pointer.
  *
  * Returns &struct device pointer on success, or ERR_PTR() on error.
- *
- * Note: the struct class passed to this function must have previously
- * been created with a call to class_create().
  */
 struct device *device_create(const struct class *class, struct device *parent,
                             dev_t devt, void *drvdata, const char *fmt, ...)
@@ -4371,9 +4368,6 @@ EXPORT_SYMBOL_GPL(device_create);
  * pointer.
  *
  * Returns &struct device pointer on success, or ERR_PTR() on error.
- *
- * Note: the struct class passed to this function must have previously
- * been created with a call to class_create().
  */
 struct device *device_create_with_groups(const struct class *class,
                                         struct device *parent, dev_t devt,
--

2.40.0