linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver core: Remove double assignment
@ 2020-09-29 11:58 poeschel
  2020-09-29 12:25 ` Greg Kroah-Hartman
  2020-10-02  7:52 ` [driver core] 9c28a17954: WARNING:at_kernel/events/core.c:#perf_event_sysfs_init kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: poeschel @ 2020-09-29 11:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, open list; +Cc: Lars Poeschel

From: Lars Poeschel <poeschel@lemonage.de>

This removes an assignment in device_add. It assigned the parent
kobject to the kobject of the  new device. This is not necessary,
because the call to kobject_add a few lines later also does this same
assignment.

Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
---
 drivers/base/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bb5806a2bd4c..03b5396cd192 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2847,8 +2847,6 @@ int device_add(struct device *dev)
 		error = PTR_ERR(kobj);
 		goto parent_error;
 	}
-	if (kobj)
-		dev->kobj.parent = kobj;
 
 	/* use parent numa_node */
 	if (parent && (dev_to_node(dev) == NUMA_NO_NODE))
@@ -2856,7 +2854,7 @@ int device_add(struct device *dev)
 
 	/* first, register with generic layer. */
 	/* we require the name to be set before, and pass NULL */
-	error = kobject_add(&dev->kobj, dev->kobj.parent, NULL);
+	error = kobject_add(&dev->kobj, kobj, NULL);
 	if (error) {
 		glue_dir = get_glue_dir(dev);
 		goto Error;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-02  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 11:58 [PATCH] driver core: Remove double assignment poeschel
2020-09-29 12:25 ` Greg Kroah-Hartman
2020-09-29 13:14   ` Lars Poeschel
2020-10-02  7:52 ` [driver core] 9c28a17954: WARNING:at_kernel/events/core.c:#perf_event_sysfs_init kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).