[PATCH] driver: soc: xilinx: Convert to platform remove callback returning void

Michal Simek michal.simek at amd.com
Mon Jul 10 04:02:43 PDT 2023



On 6/28/23 10:36, Uwe Kleine-König wrote:
> 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 only effect compared to returning
> zero is that the core emits an error message. By converting to
> .remove_new() (which is semantically equivalent to return 0 in
> .remove()) this error message is suppressed which is a good thing as
> xlnx_event_manager_remove() already emits an better error message.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>   drivers/soc/xilinx/xlnx_event_manager.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c
> index c76381899ef4..abac5880e044 100644
> --- a/drivers/soc/xilinx/xlnx_event_manager.c
> +++ b/drivers/soc/xilinx/xlnx_event_manager.c
> @@ -664,7 +664,7 @@ static int xlnx_event_manager_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -static int xlnx_event_manager_remove(struct platform_device *pdev)
> +static void xlnx_event_manager_remove(struct platform_device *pdev)
>   {
>   	int i;
>   	struct registered_event_data *eve_data;
> @@ -689,13 +689,11 @@ static int xlnx_event_manager_remove(struct platform_device *pdev)
>   	xlnx_event_cleanup_sgi(pdev);
>   
>   	event_manager_availability = -EACCES;
> -
> -	return ret;
>   }
>   
>   static struct platform_driver xlnx_event_manager_driver = {
>   	.probe = xlnx_event_manager_probe,
> -	.remove = xlnx_event_manager_remove,
> +	.remove_new = xlnx_event_manager_remove,
>   	.driver = {
>   		.name = "xlnx_event_manager",
>   	},
> 
> base-commit: 6995e2de6891c724bfeb2db33d7b87775f913ad1

Applied.
M



More information about the linux-arm-kernel mailing list