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>
This commit is contained in:
Родитель
69aea9d284
Коммит
464956f75e
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче