Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efa330cc authored by Saravana Kannan's avatar Saravana Kannan
Browse files

FROMGIT: 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: default avatarSaravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200520034824.79049-2-saravanak@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2cd38fd15e4ebcfe917a443734820269f8b5ba2b
 https: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-next)
Bug: 157691602
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Change-Id: Ia7a0122d606211edc404a2733d35182a750daa92
parent b85a8605
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -2478,7 +2478,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)
@@ -2575,11 +2574,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
@@ -2588,12 +2582,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)