public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petre Rodan <petre.rodan@subdimension.ro>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	Nuno S?? <nuno.sa@analog.com>, Andy Shevchenko <andy@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 04/18] iio: accel: bma220: split original driver
Date: Mon, 15 Sep 2025 08:05:22 +0300	[thread overview]
Message-ID: <aMeeku8OseSrTqW1@lipo> (raw)
In-Reply-To: <CAHp75VdWQojOj2MLS4dOvMKjSGcAunc4ND9SPsGrZBBctPdQgQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]


hi Andy,

On Sun, Sep 14, 2025 at 03:45:07PM +0300, Andy Shevchenko wrote:
> >           To compile this driver as a module, choose M here: the
> > -         module will be called bma220_spi.
> > +         module will be called bma220_core and you will also get
> > +         bma220_spi if SPI is enabled.
> 
> I'm not sure the last part is practical, as one needs to list all
> buses next time a new one will be added.

it's just a friendly note to the user of how the modules are called.
the sensor supports only spi and i2c, so the list is short.

> > +++ b/drivers/iio/accel/bma220.h
> 
> > +#ifndef _BMA220_H
> > +#define _BMA220_H
> > +
> > +#include <linux/pm.h>
> > +
> > +extern const struct dev_pm_ops bma220_pm_ops;
> 
> > +struct spi_device;
> 
> Besides the location of this (I would expect it to follow up include
> linux/*) convert the existing driver to regmap first and remove this
> unneeded churn.

[..]

> I haven't reviewed the rest as I believe it's just ~1:1 copy of the
> existing code, but I still think that the result will be better if
> this series starts from small fixes, like kernel doc, and other
> things, followed by the regmap conversion and only _after_ the split
> is made.

either way you look at it it can be seen as churn.

scenario 1
    split is done early: ~300 lines from _spi.c have to move to _core.c.
    I tried to do a 1:1 copy so it can be easily diffed, but small tweaks are needed here and there.

scenario 2
   split is done after regmap: much more than 300 lines need to be moved AND the code would diverge way too much from my target.

as I see it scenario 2 is worse from a reviewer's perspective and a nightmare from my pov.

I prefer to stick with scenario 1, adding a few prerequisite patches if you so prefer.
It's much easier for me to cherry pick modifications and copy them from my target code once the file structure in the patches have a _core.c, _spi.c, etc.

this is what I had in mind for v4:
split prerequisites (2-4p) -> split -> regmap prerequisites (4p) -> regmap -> regmap cleanup (2p) -> i2c -> features (5p).

best regards,
petre rodan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-09-15  5:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-13 15:39 [PATCH v3 00/18] iio: accel: bma220 improvements Petre Rodan
2025-09-13 15:39 ` [PATCH v3 01/18] dt-bindings: iio: accel: bosch,bma220 cleanup typo Petre Rodan
2025-09-13 15:39 ` [PATCH v3 02/18] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode Petre Rodan
2025-09-13 15:39 ` [PATCH v3 03/18] dt-bindings: iio: accel: bosch,bma220 set irq type in example block Petre Rodan
2025-09-18  2:08   ` Krzysztof Kozlowski
2025-09-27 14:00     ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 04/18] iio: accel: bma220: split original driver Petre Rodan
2025-09-14 12:45   ` Andy Shevchenko
2025-09-15  5:05     ` Petre Rodan [this message]
2025-09-13 15:39 ` [PATCH v3 05/18] iio: accel: bma220: add open firmware table Petre Rodan
2025-09-13 15:39 ` [PATCH v3 06/18] iio: accel: bma220: turn power supplies on Petre Rodan
2025-09-14 12:04   ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 07/18] iio: accel: bma220: move bma220_power() fct Petre Rodan
2025-09-14 12:05   ` Andy Shevchenko
2025-09-27 14:04     ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 08/18] iio: accel: bma220: reset registers during init stage Petre Rodan
2025-09-14 12:07   ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 09/18] iio: accel: bma220: relax constraints during probe() Petre Rodan
2025-09-14 12:13   ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 10/18] iio: accel: bma220: migrate to regmap API Petre Rodan
2025-09-14 12:21   ` Andy Shevchenko
2025-09-15  5:49     ` Petre Rodan
2025-09-13 15:39 ` [PATCH v3 11/18] iio: accel: bma220: populate buffer ts in trigger handler Petre Rodan
2025-09-27 14:07   ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 12/18] iio: accel: bma220: use find_match_table fct Petre Rodan
2025-09-13 15:39 ` [PATCH v3 13/18] iio: accel: bma220: add i2c module Petre Rodan
2025-09-13 15:39 ` [PATCH v3 14/18] iio: accel: bma220: add i2c watchdog feature Petre Rodan
2025-09-13 15:39 ` [PATCH v3 15/18] iio: accel: bma220: add interrupt trigger Petre Rodan
2025-09-13 16:32   ` Petre Rodan
2025-09-14 12:09     ` Andy Shevchenko
2025-09-13 18:12   ` kernel test robot
2025-09-14 12:12   ` Andy Shevchenko
2025-09-27 14:12   ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 16/18] iio: accel: bma220: add LPF cut-off frequency mapping Petre Rodan
2025-09-13 15:39 ` [PATCH v3 17/18] iio: accel: bma220: add debugfs reg access Petre Rodan
2025-09-13 15:39 ` [PATCH v3 18/18] iio: accel: bma220: add maintainer Petre Rodan

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=aMeeku8OseSrTqW1@lipo \
    --to=petre.rodan@subdimension.ro \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@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