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

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge: cdns-mhdp8546: 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>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-23-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
3438cf17 be79252e

+2 -4
+2 -4
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
··· 2596 2596 return ret; 2597 2597 } 2598 2598 2599 - static int cdns_mhdp_remove(struct platform_device *pdev) 2599 + static void cdns_mhdp_remove(struct platform_device *pdev) 2600 2600 { 2601 2601 struct cdns_mhdp_device *mhdp = platform_get_drvdata(pdev); 2602 2602 unsigned long timeout = msecs_to_jiffies(100); ··· 2634 2634 /* Ignoring mhdp->hdcp.check_work and mhdp->hdcp.prop_work here. */ 2635 2635 2636 2636 clk_disable_unprepare(mhdp->clk); 2637 - 2638 - return 0; 2639 2637 } 2640 2638 2641 2639 static const struct of_device_id mhdp_ids[] = { ··· 2656 2658 .of_match_table = mhdp_ids, 2657 2659 }, 2658 2660 .probe = cdns_mhdp_probe, 2659 - .remove = cdns_mhdp_remove, 2661 + .remove_new = cdns_mhdp_remove, 2660 2662 }; 2661 2663 module_platform_driver(mhdp_driver); 2662 2664