Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: intel: bxtwc_tmu: 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 (mostly) ignored
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.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230302144732.1903781-16-u.kleine-koenig@pengutronix.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Uwe Kleine-König and committed by
Hans de Goede
f9f23df7 d21c474c

+2 -3
+2 -3
drivers/platform/x86/intel/bxtwc_tmu.c
··· 89 89 return 0; 90 90 } 91 91 92 - static int bxt_wcove_tmu_remove(struct platform_device *pdev) 92 + static void bxt_wcove_tmu_remove(struct platform_device *pdev) 93 93 { 94 94 struct wcove_tmu *wctmu = platform_get_drvdata(pdev); 95 95 unsigned int val; ··· 101 101 regmap_read(wctmu->regmap, BXTWC_MTMUIRQ_REG, &val); 102 102 regmap_write(wctmu->regmap, BXTWC_MTMUIRQ_REG, 103 103 val | BXTWC_TMU_ALRM_MASK); 104 - return 0; 105 104 } 106 105 107 106 #ifdef CONFIG_PM_SLEEP ··· 131 132 132 133 static struct platform_driver bxt_wcove_tmu_driver = { 133 134 .probe = bxt_wcove_tmu_probe, 134 - .remove = bxt_wcove_tmu_remove, 135 + .remove_new = bxt_wcove_tmu_remove, 135 136 .driver = { 136 137 .name = "bxt_wcove_tmu", 137 138 .pm = &bxtwc_tmu_pm_ops,