summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-05-19 20:48:21 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-21 11:08:18 +0200
commit2cd38fd15e4ebcfe917a443734820269f8b5ba2b (patch)
tree2993ac4d52887ab94d73b9b87774dd83e884d70f /drivers/base
parent114dbb4fa7c4053a51964d112e2851e818e085c6 (diff)
downloadlinux-2cd38fd15e4ebcfe917a443734820269f8b5ba2b.tar.bz2
driver core: Remove unnecessary is_fwnode_dev variable in device_add()
That variable is no longer necessary. Remove it and also fix a minor typo in comments. Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200520034824.79049-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 84c569726d75..55310c97a8b7 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2526,7 +2526,6 @@ int device_add(struct device *dev)
struct class_interface *class_intf;
int error = -EINVAL;
struct kobject *glue_dir = NULL;
- bool is_fwnode_dev = false;
dev = get_device(dev);
if (!dev)
@@ -2624,11 +2623,6 @@ int device_add(struct device *dev)
kobject_uevent(&dev->kobj, KOBJ_ADD);
- if (dev->fwnode && !dev->fwnode->dev) {
- dev->fwnode->dev = dev;
- is_fwnode_dev = true;
- }
-
/*
* Check if any of the other devices (consumers) have been waiting for
* this device (supplier) to be added so that they can create a device
@@ -2637,12 +2631,14 @@ int device_add(struct device *dev)
* This needs to happen after device_pm_add() because device_link_add()
* requires the supplier be registered before it's called.
*
- * But this also needs to happe before bus_probe_device() to make sure
+ * But this also needs to happen before bus_probe_device() to make sure
* waiting consumers can link to it before the driver is bound to the
* device and the driver sync_state callback is called for this device.
*/
- if (is_fwnode_dev)
+ if (dev->fwnode && !dev->fwnode->dev) {
+ dev->fwnode->dev = dev;
fw_devlink_link_device(dev);
+ }
bus_probe_device(dev);
if (parent)