diff options
author | Uwe Kleine-König <uwe@kleine-koenig.org> | 2021-02-06 18:13:47 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2021-03-08 19:16:03 +0300 |
commit | 7c746603b5c58939ec823cff5dca3894cc3afb3b (patch) | |
tree | ced8f2457a2539137d6924b6d9d6492550fe6afe /drivers/hid/intel-ish-hid | |
parent | 464956f75e9e26bcbbcbef435213e8f5fa854d07 (diff) | |
download | linux-7c746603b5c58939ec823cff5dca3894cc3afb3b.tar.xz |
HID: intel-ish-hid: Simplify logic in ishtp_cl_device_remove()
There is only a single change in behavior: Now dev->driver isn't modified.
Assigning to this variable is in the domain of the driver core only. (And
it's done in __device_release_driver shortly after bus->remove() (i.e
ishtp_cl_device_remove() here) returns.)
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/intel-ish-hid')
-rw-r--r-- | drivers/hid/intel-ish-hid/ishtp/bus.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index ccd54f244503..7f36ce6187a1 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -258,19 +258,17 @@ static int ishtp_cl_device_remove(struct device *dev) { struct ishtp_cl_device *device = to_ishtp_cl_device(dev); struct ishtp_cl_driver *driver = to_ishtp_cl_driver(dev->driver); + int ret = 0; if (device->event_cb) { device->event_cb = NULL; cancel_work_sync(&device->event_work); } - if (!driver->remove) { - dev->driver = NULL; + if (driver->remove) + ret = driver->remove(device); - return 0; - } - - return driver->remove(device); + return ret; } /** |