From: Guenter Roeck <linux@roeck-us.net>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>, wim@linux-watchdog.org
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: f71808e_wdt: Add check for platform_driver_register
Date: Thu, 26 May 2022 07:28:41 -0700 [thread overview]
Message-ID: <1c732733-69c1-f1e4-5d5a-486dc6effb39@roeck-us.net> (raw)
In-Reply-To: <20220526080303.1005063-1-jiasheng@iscas.ac.cn>
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@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-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;
next prev parent reply other threads:[~2022-05-26 14:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 8:03 [PATCH] watchdog: f71808e_wdt: Add check for platform_driver_register Jiasheng Jiang
2022-05-26 14:28 ` Guenter Roeck [this message]
2022-07-22 9:25 williamsukatube
2022-07-22 14:12 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c732733-69c1-f1e4-5d5a-486dc6effb39@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jiasheng@iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.