Skip to content

Commit e71da1f

Browse files
ukleinekJiri Kosina
authored andcommitted
HID: intel-ish-hid: Make remove callback return void
The driver core ignores the return value of struct bus_type::remove() because there is only little that can be done. To simplify the quest to make this function return void, let struct ishtp_cl_driver::remove() return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error value is a bad idea. 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 7c74660 commit e71da1f

5 files changed

Lines changed: 6 additions & 13 deletions

File tree

drivers/hid/intel-ish-hid/ishtp-fw-loader.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ static int loader_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
10151015
*
10161016
* Return: 0
10171017
*/
1018-
static int loader_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
1018+
static void loader_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
10191019
{
10201020
struct ishtp_cl_data *client_data;
10211021
struct ishtp_cl *loader_ishtp_cl = ishtp_get_drvdata(cl_device);
@@ -1032,8 +1032,6 @@ static int loader_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
10321032
cancel_work_sync(&client_data->work_ishtp_reset);
10331033
loader_deinit(loader_ishtp_cl);
10341034
ishtp_put_device(cl_device);
1035-
1036-
return 0;
10371035
}
10381036

10391037
/**

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
838838
*
839839
* Return: 0
840840
*/
841-
static int hid_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
841+
static void hid_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
842842
{
843843
struct ishtp_cl *hid_ishtp_cl = ishtp_get_drvdata(cl_device);
844844
struct ishtp_cl_data *client_data = ishtp_get_client_data(hid_ishtp_cl);
@@ -856,8 +856,6 @@ static int hid_ishtp_cl_remove(struct ishtp_cl_device *cl_device)
856856
hid_ishtp_cl = NULL;
857857

858858
client_data->num_hid_devices = 0;
859-
860-
return 0;
861859
}
862860

863861
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,16 @@ static int ishtp_cl_device_remove(struct device *dev)
258258
{
259259
struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
260260
struct ishtp_cl_driver *driver = to_ishtp_cl_driver(dev->driver);
261-
int ret = 0;
262261

263262
if (device->event_cb) {
264263
device->event_cb = NULL;
265264
cancel_work_sync(&device->event_work);
266265
}
267266

268267
if (driver->remove)
269-
ret = driver->remove(device);
268+
driver->remove(device);
270269

271-
return ret;
270+
return 0;
272271
}
273272

274273
/**

drivers/platform/chrome/cros_ec_ishtp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device)
703703
*
704704
* Return: 0
705705
*/
706-
static int cros_ec_ishtp_remove(struct ishtp_cl_device *cl_device)
706+
static void cros_ec_ishtp_remove(struct ishtp_cl_device *cl_device)
707707
{
708708
struct ishtp_cl *cros_ish_cl = ishtp_get_drvdata(cl_device);
709709
struct ishtp_cl_data *client_data = ishtp_get_client_data(cros_ish_cl);
@@ -712,8 +712,6 @@ static int cros_ec_ishtp_remove(struct ishtp_cl_device *cl_device)
712712
cancel_work_sync(&client_data->work_ec_evt);
713713
cros_ish_deinit(cros_ish_cl);
714714
ishtp_put_device(cl_device);
715-
716-
return 0;
717715
}
718716

719717
/**

include/linux/intel-ish-client-if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ishtp_cl_driver {
3636
const char *name;
3737
const guid_t *guid;
3838
int (*probe)(struct ishtp_cl_device *dev);
39-
int (*remove)(struct ishtp_cl_device *dev);
39+
void (*remove)(struct ishtp_cl_device *dev);
4040
int (*reset)(struct ishtp_cl_device *dev);
4141
const struct dev_pm_ops *pm;
4242
};

0 commit comments

Comments
 (0)