From: Saravana Kannan <saravanak@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
linux-kernel@vger.kernel.org,
John Stultz <john.stultz@linaro.org>,
kernel-team@android.com
Subject: [PATCH v2 1/4] driver core: Remove unnecessary is_fwnode_dev variable in device_add()
Date: Tue, 19 May 2020 20:48:21 -0700 [thread overview]
Message-ID: <20200520034824.79049-2-saravanak@google.com> (raw)
In-Reply-To: <20200520034824.79049-1-saravanak@google.com>
That variable is no longer necessary. Remove it and also fix a minor
typo in comments.
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/base/core.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index f804e561e0a2..6dbee5885abb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2543,7 +2543,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)
@@ -2641,11 +2640,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
@@ -2654,12 +2648,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)
--
2.26.2.761.g0e0b3e54be-goog
next prev parent reply other threads:[~2020-05-20 3:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 3:48 [PATCH v2 0/4] driver core: Add device link related sysfs files Saravana Kannan
2020-05-20 3:48 ` Saravana Kannan [this message]
2020-05-20 3:48 ` [PATCH v2 2/4] driver core: Expose device link details in sysfs Saravana Kannan
2020-05-20 3:48 ` [PATCH v2 3/4] driver core: Add state_synced sysfs file for devices that support it Saravana Kannan
2020-05-20 3:48 ` [PATCH v2 4/4] driver core: Add waiting_for_supplier sysfs file for devices Saravana Kannan
2020-05-21 9:42 ` [PATCH v2 0/4] driver core: Add device link related sysfs files Greg Kroah-Hartman
2020-05-21 16:50 ` Saravana Kannan
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=20200520034824.79049-2-saravanak@google.com \
--to=saravanak@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--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;
as well as URLs for NNTP newsgroup(s).