public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Sa, Nuno" <Nuno.Sa@analog.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v1 1/1] iio: dac: ltc2688: Use temporary variable for struct device
Date: Sun, 20 Mar 2022 15:41:39 +0000	[thread overview]
Message-ID: <20220320154139.104b07f2@jic23-huawei> (raw)
In-Reply-To: <PH0PR03MB678602F6E1B491B2A882BC7C99049@PH0PR03MB6786.namprd03.prod.outlook.com>

On Thu, 3 Mar 2022 13:34:00 +0000
"Sa, Nuno" <Nuno.Sa@analog.com> wrote:

> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Wednesday, March 2, 2022 4:32 PM
> > To: Sa, Nuno <Nuno.Sa@analog.com>; Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com>; linux-iio@vger.kernel.org;
> > linux-kernel@vger.kernel.org
> > Cc: Jonathan Cameron <jic23@kernel.org>; Lars-Peter Clausen
> > <lars@metafoo.de>
> > Subject: [PATCH v1 1/1] iio: dac: ltc2688: Use temporary variable for
> > struct device
> > 
> > [External]
> > 
> > Use temporary variable for struct device to make code neater.
> > 
> > Signed-off-by: Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com>
> > ---  
> 
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Applied to the togreg branch of iio.git but I'll be rebaseing that
on rc1 so for now just pushed out as testing so 0-day can take
a look at it.

Thanks,

Jonathan

> 
> >  drivers/iio/dac/ltc2688.c | 19 +++++++++----------
> >  1 file changed, 9 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/iio/dac/ltc2688.c b/drivers/iio/dac/ltc2688.c
> > index e41861d29767..d249fa28202c 100644
> > --- a/drivers/iio/dac/ltc2688.c
> > +++ b/drivers/iio/dac/ltc2688.c
> > @@ -703,21 +703,20 @@ static int ltc2688_tgp_clk_setup(struct
> > ltc2688_state *st,
> >  				 struct ltc2688_chan *chan,
> >  				 struct fwnode_handle *node, int tgp)
> >  {
> > +	struct device *dev = &st->spi->dev;
> >  	unsigned long rate;
> >  	struct clk *clk;
> >  	int ret, f;
> > 
> > -	clk = devm_get_clk_from_child(&st->spi->dev,
> > to_of_node(node), NULL);
> > +	clk = devm_get_clk_from_child(dev, to_of_node(node),
> > NULL);
> >  	if (IS_ERR(clk))
> > -		return dev_err_probe(&st->spi->dev, PTR_ERR(clk),
> > -				     "failed to get tgp clk.\n");
> > +		return dev_err_probe(dev, PTR_ERR(clk), "failed to get
> > tgp clk.\n");
> > 
> >  	ret = clk_prepare_enable(clk);
> >  	if (ret)
> > -		return dev_err_probe(&st->spi->dev, ret,
> > -				     "failed to enable tgp clk.\n");
> > +		return dev_err_probe(dev, ret, "failed to enable tgp
> > clk.\n");
> > 
> > -	ret = devm_add_action_or_reset(&st->spi->dev,
> > ltc2688_clk_disable, clk);
> > +	ret = devm_add_action_or_reset(dev, ltc2688_clk_disable,
> > clk);
> >  	if (ret)
> >  		return ret;
> > 
> > @@ -858,6 +857,7 @@ static int ltc2688_channel_config(struct
> > ltc2688_state *st)
> > 
> >  static int ltc2688_setup(struct ltc2688_state *st, struct regulator *vref)
> >  {
> > +	struct device *dev = &st->spi->dev;
> >  	struct gpio_desc *gpio;
> >  	int ret;
> > 
> > @@ -865,10 +865,9 @@ static int ltc2688_setup(struct ltc2688_state
> > *st, struct regulator *vref)
> >  	 * If we have a reset pin, use that to reset the board, If not, use
> >  	 * the reset bit.
> >  	 */
> > -	gpio = devm_gpiod_get_optional(&st->spi->dev, "clr",
> > GPIOD_OUT_HIGH);
> > +	gpio = devm_gpiod_get_optional(dev, "clr",
> > GPIOD_OUT_HIGH);
> >  	if (IS_ERR(gpio))
> > -		return dev_err_probe(&st->spi->dev, PTR_ERR(gpio),
> > -				     "Failed to get reset gpio");
> > +		return dev_err_probe(dev, PTR_ERR(gpio), "Failed to
> > get reset gpio");
> >  	if (gpio) {
> >  		usleep_range(1000, 1200);
> >  		/* bring device out of reset */
> > @@ -887,7 +886,7 @@ static int ltc2688_setup(struct ltc2688_state *st,
> > struct regulator *vref)
> >  	 * Duplicate the default channel configuration as it can change
> > during
> >  	 * @ltc2688_channel_config()
> >  	 */
> > -	st->iio_chan = devm_kmemdup(&st->spi->dev,
> > ltc2688_channels,
> > +	st->iio_chan = devm_kmemdup(dev, ltc2688_channels,
> >  				    sizeof(ltc2688_channels),
> > GFP_KERNEL);
> >  	if (!st->iio_chan)
> >  		return -ENOMEM;
> > --
> > 2.34.1  
> 


      reply	other threads:[~2022-03-20 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 15:31 [PATCH v1 1/1] iio: dac: ltc2688: Use temporary variable for struct device Andy Shevchenko
2022-03-03 13:34 ` Sa, Nuno
2022-03-20 15:41   ` Jonathan Cameron [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=20220320154139.104b07f2@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Nuno.Sa@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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