summaryrefslogtreecommitdiffstats
path: root/drivers/hid/intel-ish-hid
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2021-02-06 16:13:46 +0100
committerJiri Kosina <jkosina@suse.cz>2021-03-08 17:16:03 +0100
commit464956f75e9e26bcbbcbef435213e8f5fa854d07 (patch)
treec12dfc39c6ada224e3cbabb1229565cc1a4a0cd5 /drivers/hid/intel-ish-hid
parent69aea9d2843669387d100e353b5113d1adc9502f (diff)
downloadlinux-464956f75e9e26bcbbcbef435213e8f5fa854d07.tar.bz2
HID: intel-ish-hid: Drop if block with an always false condition
A remove callback is only ever called for a bound device. So there is no need to check for device or driver being NULL. 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.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index bba29cd36d29..ccd54f244503 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -257,17 +257,13 @@ static int ishtp_cl_bus_match(struct device *dev, struct device_driver *drv)
static int ishtp_cl_device_remove(struct device *dev)
{
struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
- struct ishtp_cl_driver *driver;
-
- if (!device || !dev->driver)
- return 0;
+ struct ishtp_cl_driver *driver = to_ishtp_cl_driver(dev->driver);
if (device->event_cb) {
device->event_cb = NULL;
cancel_work_sync(&device->event_work);
}
- driver = to_ishtp_cl_driver(dev->driver);
if (!driver->remove) {
dev->driver = NULL;