[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHb3i=v+LV=sGCX8obuy=sXBFvnP9k-THb=mGw4ze8M5AVCYoQ@mail.gmail.com>
Date: Thu, 26 May 2022 14:42:20 +0300
From: Tali Perry <tali.perry1@...il.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: avifishman70@...il.com, Tomer Maimon <tmaimon77@...il.com>,
Patrick Venture <venture@...gle.com>,
Nancy Yuen <yuenn@...gle.com>,
Benjamin Fair <benjaminfair@...gle.com>,
OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
Linux I2C <linux-i2c@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] i2c: npcm7xx: barco-p50-gpio: Add check for platform_driver_register
On Thu, May 26, 2022 at 12:41 PM Jiasheng Jiang <jiasheng@...as.ac.cn> 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: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> drivers/i2c/busses/i2c-npcm7xx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
> index 71aad029425d..08737fa2dcbf 100644
> --- a/drivers/i2c/busses/i2c-npcm7xx.c
> +++ b/drivers/i2c/busses/i2c-npcm7xx.c
> @@ -2336,8 +2336,7 @@ static struct platform_driver npcm_i2c_bus_driver = {
> static int __init npcm_i2c_init(void)
> {
> npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL);
> - platform_driver_register(&npcm_i2c_bus_driver);
> - return 0;
> + return platform_driver_register(&npcm_i2c_bus_driver);
> }
> module_init(npcm_i2c_init);
>
> --
> 2.25.1
>
thanks, Jiansheng !
Acked-by: Tali Perry <tali.perry1@...il.com>
Powered by blists - more mailing lists