[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1c732733-69c1-f1e4-5d5a-486dc6effb39@roeck-us.net>
Date: Thu, 26 May 2022 07:28:41 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>, wim@...ux-watchdog.org
Cc: linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog: f71808e_wdt: Add check for
platform_driver_register
On 5/26/22 01:03, Jiasheng Jiang wrote:
> As platform_driver_register() could fail, it should be better
> to deal with the return value in order to maintain the code
> consisitency.
>
> Fixes: 27e0fe00a5c6 ("watchdog: f71808e_wdt: refactor to platform device/driver pair")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> drivers/watchdog/f71808e_wdt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
> index 7f59c680de25..6a16d3d0bb1e 100644
> --- a/drivers/watchdog/f71808e_wdt.c
> +++ b/drivers/watchdog/f71808e_wdt.c
> @@ -634,7 +634,9 @@ static int __init fintek_wdt_init(void)
>
> pdata.type = ret;
>
> - platform_driver_register(&fintek_wdt_driver);
> + ret = platform_driver_register(&fintek_wdt_driver);
> + if (ret)
> + return ret;
>
> wdt_res.name = "superio port";
> wdt_res.flags = IORESOURCE_IO;
Powered by blists - more mailing lists