extcon: max77843: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/30097beba928bf2073645f85d21fb9c1aee64991.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
This commit is contained in:
parent
ba6985eac3
commit
9688b1d070
@ -928,7 +928,7 @@ err_muic_irq:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int max77843_muic_remove(struct platform_device *pdev)
|
||||
static void max77843_muic_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct max77843_muic_info *info = platform_get_drvdata(pdev);
|
||||
struct max77693_dev *max77843 = info->max77843;
|
||||
@ -936,8 +936,6 @@ static int max77843_muic_remove(struct platform_device *pdev)
|
||||
cancel_work_sync(&info->irq_work);
|
||||
regmap_del_irq_chip(max77843->irq, max77843->irq_data_muic);
|
||||
i2c_unregister_device(max77843->i2c_muic);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct platform_device_id max77843_muic_id[] = {
|
||||
@ -958,7 +956,7 @@ static struct platform_driver max77843_muic_driver = {
|
||||
.of_match_table = of_max77843_muic_dt_match,
|
||||
},
|
||||
.probe = max77843_muic_probe,
|
||||
.remove = max77843_muic_remove,
|
||||
.remove_new = max77843_muic_remove,
|
||||
.id_table = max77843_muic_id,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user