linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Xidong Wang <wangxidong_97@163.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] rtc: rv3028: check return value
Date: Sat, 1 Jun 2019 23:03:36 +0200	[thread overview]
Message-ID: <20190601210336.GA3558@piout.net> (raw)
In-Reply-To: <1559114540-30878-1-git-send-email-wangxidong_97@163.com>

Hello,

On 29/05/2019 15:22:20+0800, Xidong Wang wrote:
> In rv3028_probe(), the return value of devm_regmap_init_i2c() should
> be checked before it is used.
> 
> Signed-off-by: Xidong Wang <wangxidong_97@163.com>
> ---
>  drivers/rtc/rtc-rv3028.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
> index 06884eb..29a8c4e 100644
> --- a/drivers/rtc/rtc-rv3028.c
> +++ b/drivers/rtc/rtc-rv3028.c
> @@ -626,6 +626,10 @@ static int rv3028_probe(struct i2c_client *client)
>  
>  	rv3028->regmap = devm_regmap_init_i2c(client, &regmap_config);
>  

Remove that empty line.

> +	if (IS_ERR(rv3028->regmap)) {
> +		return PTR_ERR(rv3028->regmap);
> +	}

Unnecessary braces.

> +
>  	i2c_set_clientdata(client, rv3028);
>  
>  	ret = regmap_read(rv3028->regmap, RV3028_STATUS, &status);
> -- 
> 2.7.4
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2019-06-01 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  7:22 [PATCH 1/1] rtc: rv3028: check return value Xidong Wang
2019-06-01 21:03 ` Alexandre Belloni [this message]

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=20190601210336.GA3558@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=wangxidong_97@163.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).