Skip to content

Commit

Permalink
HID: intel-ish-hid: Simplify logic in ishtp_cl_device_remove()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
ukleinek authored and Jiri Kosina committed Mar 8, 2021
1 parent 464956f commit 7c74660
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/hid/intel-ish-hid/ishtp/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 7c74660

Please sign in to comment.