[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VegnLShEPHg=aRG=M3kf36M3tHPL7Jwz-i=A3Z48-2pYA@mail.gmail.com>
Date: Wed, 6 Jul 2022 14:36:04 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc: Kevin Tsai <ktsai@...ellamicro.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Hans de Goede <hdegoede@...hat.com>,
linux-iio <linux-iio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iio: light: cm32181: Add PM support
On Wed, Jul 6, 2022 at 4:02 AM Kai-Heng Feng
<kai.heng.feng@...onical.com> wrote:
> On Wed, Jul 6, 2022 at 3:12 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > On Tue, Jul 5, 2022 at 2:31 PM Kai-Heng Feng
> > <kai.heng.feng@...onical.com> wrote:
...
> > > +static int cm32181_resume(struct device *dev)
> > > +{
> > > + struct i2c_client *client = to_i2c_client(dev);
> > > + struct cm32181_chip *cm32181 = iio_priv(i2c_get_clientdata(client));
> >
> > Simply device_get_drvdata(dev) ?
>
> iio_priv() is still needed to get the struct priv.
I'm not objecting to that. My point is that you don't need to
dereference dev --> client --> dev.
And yes, I see that client is still used, but it's again not about my point.
> > > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
> > > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]);
> > > +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists