linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Wang Zhang <silver_code@hust.edu.cn>
Cc: Peter Korsgaard <peter@korsgaard.com>,
	Andrew Lunn <andrew@lunn.ch>,
	hust-os-kernel-patches@googlegroups.com,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] i2c: ocores: use devm_ managed clks
Date: Thu, 25 May 2023 12:28:55 +0300	[thread overview]
Message-ID: <34eaac7a-993a-4f87-968d-1e3f683784cc@kili.mountain> (raw)
In-Reply-To: <2ca66dae-8424-4382-a0ed-ff742921c495@kili.mountain>

On Thu, May 25, 2023 at 08:02:02AM +0300, Dan Carpenter wrote:
> On Wed, May 24, 2023 at 11:43:18PM +0800, Wang Zhang wrote:
> > @@ -780,19 +768,18 @@ static int ocores_i2c_resume(struct device *dev)
> >  {
> >  	struct ocores_i2c *i2c = dev_get_drvdata(dev);
> >  
> > -	if (!IS_ERR(i2c->clk)) {
> > -		unsigned long rate;
> > -		int ret = clk_prepare_enable(i2c->clk);
> > +	unsigned long rate;
> > +	int ret = clk_prepare_enable(i2c->clk);
> 
> Don't put functions which can fail in the declaration block.  Generally
> the declaration block is for preliminary stuff, and the important
> actions should be in the code block.  There should not be a blank line
> before the function call and the error checking.

s/before/between/.

regards,
dan carpenter


      reply	other threads:[~2023-05-25  9:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16  7:20 [PATCH] i2c: ocores: add missing unwind goto in `ocores_i2c_probe` Wang Zhang
2023-04-16 15:33 ` Andrew Lunn
2023-04-17 13:27   ` [PATCH v2] i2c: ocores: use devm_ managed clks Wang Zhang
2023-04-17 14:05   ` Wang Zhang
2023-04-17 14:29     ` Peter Rosin
2023-04-17 15:50     ` Andrew Lunn
2023-04-22 12:32       ` [PATCH v3] " Wang Zhang
2023-04-25  9:58         ` 张网
2023-04-25 11:57         ` Andrew Lunn
2023-04-25 14:47           ` 张网
2023-04-25 15:06             ` Andrew Lunn
2023-05-26  7:05               ` [PATCH v4] " Wang Zhang
2023-06-13 23:54                 ` Andi Shyti
2023-06-23  8:22                 ` Wolfram Sang
2023-06-23  8:26                   ` Wolfram Sang
2023-05-23  4:49           ` Re: [PATCH v3] " 张网
2023-05-23 12:10             ` Andrew Lunn
2023-05-23 14:33             ` Wang Zhang
2023-05-24 15:35             ` Wang Zhang
2023-05-24 15:43             ` Wang Zhang
2023-05-24 18:45               ` Dan Carpenter
2023-05-24 19:21               ` Christophe JAILLET
2023-05-25  3:33                 ` 张网
2023-05-25 19:16                   ` Christophe JAILLET
2023-05-25  5:05                 ` Dan Carpenter
2023-05-25  5:02               ` Dan Carpenter
2023-05-25  9:28                 ` Dan Carpenter [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=34eaac7a-993a-4f87-968d-1e3f683784cc@kili.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@korsgaard.com \
    --cc=silver_code@hust.edu.cn \
    /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).