From: Jonathan Cameron <jic23@kernel.org>
To: Alex Lanzano <lanzano.alex@gmail.com>
Cc: Gustavo Silva <gustavograzs@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: imu: bmi270: move private struct declaration to source file
Date: Sat, 22 Feb 2025 17:28:51 +0000 [thread overview]
Message-ID: <20250222172851.5ff3fa79@jic23-huawei> (raw)
In-Reply-To: <mtmwjyo2jd5pmne4od6fsq3qkhh7smeafviu3bhjoafpv55dur@seepjddh4y7z>
On Sat, 22 Feb 2025 11:25:21 -0500
Alex Lanzano <lanzano.alex@gmail.com> wrote:
> On Wed, Feb 19, 2025 at 08:54:45PM -0300, Gustavo Silva wrote:
> > The device's private data struct is currently declared in the header
> > file, but it does not need to be exposed there. Move it to the driver's
> > core source file to avoid unnecessary #include directives or forward
> > declarations in the header.
> >
> > Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
> Acked-by: Alex Lanzano <lanzano.alex@gmail.com>
A good cleanup. So applied before I even look at 2 and 3!
Thanks,
Jonathan
> > ---
> > drivers/iio/imu/bmi270/bmi270.h | 17 +----------------
> > drivers/iio/imu/bmi270/bmi270_core.c | 15 +++++++++++++++
> > 2 files changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/iio/imu/bmi270/bmi270.h b/drivers/iio/imu/bmi270/bmi270.h
> > index fdfad5784cc52043475b6816286619fac5824684..d94525f6aee85f21cc9e9ae1bc9c1db0dc00b927 100644
> > --- a/drivers/iio/imu/bmi270/bmi270.h
> > +++ b/drivers/iio/imu/bmi270/bmi270.h
> > @@ -6,22 +6,6 @@
> > #include <linux/regmap.h>
> > #include <linux/iio/iio.h>
> >
> > -struct device;
> > -struct bmi270_data {
> > - struct device *dev;
> > - struct regmap *regmap;
> > - const struct bmi270_chip_info *chip_info;
> > -
> > - /*
> > - * Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
> > - * that to ensure a DMA safe buffer.
> > - */
> > - struct {
> > - __le16 channels[6];
> > - aligned_s64 timestamp;
> > - } data __aligned(IIO_DMA_MINALIGN);
> > -};
> > -
> > struct bmi270_chip_info {
> > const char *name;
> > int chip_id;
> > @@ -32,6 +16,7 @@ extern const struct regmap_config bmi270_regmap_config;
> > extern const struct bmi270_chip_info bmi260_chip_info;
> > extern const struct bmi270_chip_info bmi270_chip_info;
> >
> > +struct device;
> > int bmi270_core_probe(struct device *dev, struct regmap *regmap,
> > const struct bmi270_chip_info *chip_info);
> >
> > diff --git a/drivers/iio/imu/bmi270/bmi270_core.c b/drivers/iio/imu/bmi270/bmi270_core.c
> > index 464dcdd657c4ba27fdb7620c80e9f05e2a831910..9f24d4044ed6f00f67fd3a8f5adda821c3140a18 100644
> > --- a/drivers/iio/imu/bmi270/bmi270_core.c
> > +++ b/drivers/iio/imu/bmi270/bmi270_core.c
> > @@ -78,6 +78,21 @@
> > #define BMI260_INIT_DATA_FILE "bmi260-init-data.fw"
> > #define BMI270_INIT_DATA_FILE "bmi270-init-data.fw"
> >
> > +struct bmi270_data {
> > + struct device *dev;
> > + struct regmap *regmap;
> > + const struct bmi270_chip_info *chip_info;
> > +
> > + /*
> > + * Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
> > + * that to ensure a DMA safe buffer.
> > + */
> > + struct {
> > + __le16 channels[6];
> > + aligned_s64 timestamp;
> > + } data __aligned(IIO_DMA_MINALIGN);
> > +};
> > +
> > enum bmi270_scan {
> > BMI270_SCAN_ACCEL_X,
> > BMI270_SCAN_ACCEL_Y,
> >
> > --
> > 2.48.1
> >
next prev parent reply other threads:[~2025-02-22 17:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 23:54 [PATCH 0/3] BMI270 data ready interrupt support Gustavo Silva
2025-02-19 23:54 ` [PATCH 1/3] iio: imu: bmi270: move private struct declaration to source file Gustavo Silva
2025-02-22 16:25 ` Alex Lanzano
2025-02-22 17:28 ` Jonathan Cameron [this message]
2025-02-19 23:54 ` [PATCH 2/3] iio: imu: bmi270: rename variable bmi270_device to data Gustavo Silva
2025-02-22 16:39 ` Alex Lanzano
2025-02-22 17:31 ` Jonathan Cameron
2025-02-19 23:54 ` [PATCH 3/3] iio: imu: bmi270: add support for data ready interrupt trigger Gustavo Silva
2025-02-22 21:05 ` Alex Lanzano
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=20250222172851.5ff3fa79@jic23-huawei \
--to=jic23@kernel.org \
--cc=gustavograzs@gmail.com \
--cc=lanzano.alex@gmail.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