[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200415143133.qwbes5whbqx5jf2j@pengutronix.de>
Date: Wed, 15 Apr 2020 16:31:33 +0200
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Tang Bin <tangbin@...s.chinamobile.com>
Cc: wsa@...-dreams.de, o.rempel@...gutronix.de, ardb@...nel.org,
linux-i2c@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Shengju Zhang <zhangshengju@...s.chinamobile.com>
Subject: Re: [PATCH] i2c: drivers: Avoid unnecessary check in
efm32_i2c_probe()
Hello,
On Wed, Apr 15, 2020 at 10:06:40PM +0800, Tang Bin wrote:
> The function efm32_i2c_probe() is only called with an
> openfirmware platform device.Therefore there is no need
> to check that it has an openfirmware node.
>
> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
> Signed-off-by: Shengju Zhang <zhangshengju@...s.chinamobile.com>
Same things apply as in the previous patch. (space after punctuation,
Sob of sender should be last)
> ---
> drivers/i2c/busses/i2c-efm32.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-efm32.c b/drivers/i2c/busses/i2c-efm32.c
> index 4de31fae7..4786ef6b2 100644
> --- a/drivers/i2c/busses/i2c-efm32.c
> +++ b/drivers/i2c/busses/i2c-efm32.c
> @@ -312,9 +312,6 @@ static int efm32_i2c_probe(struct platform_device *pdev)
> int ret;
> u32 clkdiv;
>
> - if (!np)
> - return -EINVAL;
> -
I don't care much about this change. While the statement that this
driver is only instantiated on dt platforms is probably right,
explicitly checking for it might still prevent surprises later, serves
as explicit statement for the driver reader that non-dt isn't supposed
to work and given that the check is cheap I tend slightly to just keep
it.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Powered by blists - more mailing lists