linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: wsa@the-dreams.de, o.rempel@pengutronix.de, ardb@kernel.org,
	linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Subject: Re: [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe()
Date: Wed, 15 Apr 2020 16:31:33 +0200	[thread overview]
Message-ID: <20200415143133.qwbes5whbqx5jf2j@pengutronix.de> (raw)
In-Reply-To: <20200415140640.19948-1-tangbin@cmss.chinamobile.com>

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@cmss.chinamobile.com>
> Signed-off-by: Shengju Zhang <zhangshengju@cmss.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/ |

  reply	other threads:[~2020-04-15 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 14:06 [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe() Tang Bin
2020-04-15 14:31 ` Uwe Kleine-König [this message]
2020-04-16  1:30   ` [PATCH] i2c: drivers: Avoid unnecessary check inefm32_i2c_probe() Tang Bin
2020-04-16  6:50     ` Uwe Kleine-König
2020-04-16  9:00       ` Tang Bin
2020-05-22 15:07 ` [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe() Wolfram Sang

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=20200415143133.qwbes5whbqx5jf2j@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=ardb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=wsa@the-dreams.de \
    --cc=zhangshengju@cmss.chinamobile.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).