Skip to content

Commit 464956f

Browse files
ukleinekJiri Kosina
authored andcommitted
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>
1 parent 69aea9d commit 464956f

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • drivers/hid/intel-ish-hid/ishtp

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,13 @@ static int ishtp_cl_bus_match(struct device *dev, struct device_driver *drv)
257257
static int ishtp_cl_device_remove(struct device *dev)
258258
{
259259
struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
260-
struct ishtp_cl_driver *driver;
261-
262-
if (!device || !dev->driver)
263-
return 0;
260+
struct ishtp_cl_driver *driver = to_ishtp_cl_driver(dev->driver);
264261

265262
if (device->event_cb) {
266263
device->event_cb = NULL;
267264
cancel_work_sync(&device->event_work);
268265
}
269266

270-
driver = to_ishtp_cl_driver(dev->driver);
271267
if (!driver->remove) {
272268
dev->driver = NULL;
273269

0 commit comments

Comments
 (0)