[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZwreoHXXLkf3DjMt@surfacebook.localdomain>
Date: Sat, 12 Oct 2024 23:40:00 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Vasileios Aoiridis <vassilisamir@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, jic23@...nel.org,
lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, anshulusr@...il.com, gustavograzs@...il.com,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 08/13] iio: chemical: bme680: add power management
Fri, Oct 11, 2024 at 09:02:32PM +0200, Vasileios Aoiridis kirjoitti:
> On Fri, Oct 11, 2024 at 01:10:20PM +0300, Andy Shevchenko wrote:
> > On Thu, Oct 10, 2024 at 11:00:25PM +0200, vamoirid wrote:
...
> > > +extern const struct dev_pm_ops bmp280_dev_pm_ops;
> >
> > Is pm.h being included already in this header? Otherwise you need to add it.
>
> No it is not, and indeed I need to add it. Probably because it was
> included by some other file I didn't get an error from gcc?
Yeah, it's called a "proxy" header in general meaning. We should try hard not
to use such headers (meaning not to use them in a "proxy" mode).
...
> > > struct regmap *regmap;
> > > struct bme680_calib bme680;
> > > struct mutex lock; /* Protect multiple serial R/W ops to device. */
> > > + struct device *dev;
> >
> > Is it the same that you may get wia regmap_get_device()?
> >
>
> Yes it is the same. Maybe I can try and see if I can use the following
>
> regmap_get_device(data->regmap)
>
> in the places where the pm functions are used in order to not declare a
> new value inside the struct bme680_data. But in general, is this approach
> prefered?
Since there is a getter already available, I prefer not to shortcut it via
adding a duplicating information to the data structure.
> > > u8 oversampling_temp;
> > > u8 oversampling_press;
> > > u8 oversampling_humid;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists