public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Vasileios Amoiridis <vassilisamir@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Vasileios Amoiridis <vassilisamir@gmail.com>,
	lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, andriy.shevchenko@linux.intel.com,
	ang.iglesiasg@gmail.com, linus.walleij@linaro.org,
	biju.das.jz@bp.renesas.com, javier.carrasco.cruz@gmail.com,
	semen.protsenko@linaro.org, 579lpy@gmail.com, ak@it-klinger.de,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 7/7] iio: pressure bmp280: Move bmp085 interrupt to new configuration
Date: Wed, 21 Aug 2024 23:58:01 +0200	[thread overview]
Message-ID: <20240821215801.GB478206@vamoiridPC> (raw)
In-Reply-To: <20240728170915.26b4a01d@jic23-huawei>

On Sun, Jul 28, 2024 at 05:09:15PM +0100, Jonathan Cameron wrote:
> On Fri, 26 Jul 2024 01:10:39 +0200
> Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> 
> > This commit intends to add the old BMP085 sensor to the new IRQ interface
> > of the sensor consistence. No functional changes intended.
> > 
> > The BMP085 sensor is equivalent with the BMP180 with the only difference of
> > BMP085 having an extra interrupt pin to inform about an End of Conversion.
> > 
> > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> Trivial comments inline + as the build bot pointed out you can't use data from
> one array to fill the other.
> 
> Jonathan
> 
> > ---
> >  drivers/iio/pressure/bmp280-core.c | 72 +++++++++++++++++++++++-------
> >  drivers/iio/pressure/bmp280-i2c.c  |  4 +-
> >  drivers/iio/pressure/bmp280-spi.c  |  4 +-
> >  drivers/iio/pressure/bmp280.h      |  1 +
> >  4 files changed, 60 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> > index 4238f37b7805..e4d017358b68 100644
> > --- a/drivers/iio/pressure/bmp280-core.c
> > +++ b/drivers/iio/pressure/bmp280-core.c
> > @@ -3104,13 +3104,19 @@ static irqreturn_t bmp085_eoc_irq(int irq, void *d)
> >  	return IRQ_HANDLED;
> >  }
> >  
> > -static int bmp085_fetch_eoc_irq(struct device *dev,
> > -				const char *name,
> > -				int irq,
> > -				struct bmp280_data *data)
> > +static int bmp085_trigger_probe(struct iio_dev *indio_dev)
> >  {
> > +	struct bmp280_data *data = iio_priv(indio_dev);
> > +	struct device *dev = data->dev;
> > +	struct fwnode_handle *fwnode;
> >  	unsigned long irq_trig;
> > -	int ret;
> > +	int ret, irq;
> > +
> > +	fwnode = dev_fwnode(data->dev);
> > +	if (!fwnode)
> > +		return -ENODEV;
> > +
> > +	irq = fwnode_irq_get(fwnode, 0);
> >  
> >  	irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq));
> >  	if (irq_trig != IRQF_TRIGGER_RISING) {
> > @@ -3120,13 +3126,12 @@ static int bmp085_fetch_eoc_irq(struct device *dev,
> >  
> >  	init_completion(&data->done);
> >  
> > -	ret = devm_request_threaded_irq(dev,
> > -			irq,
> > -			bmp085_eoc_irq,
> > -			NULL,
> > -			irq_trig,
> > -			name,
> > -			data);
> > +	ret = devm_request_irq(dev,
> > +			       irq,
> > +			       bmp085_eoc_irq,
> > +			       irq_trig,
> > +			       indio_dev->name,
> > +			       data);
> Whilst here, put some of those parameters on the same line (staying below
> 80 chars).
> 

Ack. I was aiming for as less intrusive change as possible.

> >  	if (ret) {
> >  		/* Bail out without IRQ but keep the driver in place */
> >  		dev_err(dev, "unable to request DRDY IRQ\n");
> > @@ -3137,6 +3142,44 @@ static int bmp085_fetch_eoc_irq(struct device *dev,
> >  	return 0;
> >  }
> >  
> > +const struct bmp280_chip_info bmp085_chip_info = {
> > +	.id_reg = bmp180_chip_info.id_reg,
> As the build bot has pointed out you can't do this.
> Annoying but just duplicate the original structure with whatever
> changes you need.
> 

Extremely annoying because it is litteraly just one addition in the
new array and everything else stays the same...

Cheers,
Vasilis

      reply	other threads:[~2024-08-21 21:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 23:10 [PATCH v2 0/7] pressure: bmp280: Minor cleanup and interrupt support Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 1/7] iio: pressure: bmp280: Use bulk read for humidity calibration data Vasileios Amoiridis
2024-07-28 15:46   ` Jonathan Cameron
2024-08-21 21:24     ` Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 2/7] iio: pressure: bmp280: Add support for bmp280 soft reset Vasileios Amoiridis
2024-07-28 15:49   ` Jonathan Cameron
2024-08-21 21:32     ` Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 3/7] iio: pressure: bmp280: Remove config error check for IIR filter updates Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 4/7] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures Vasileios Amoiridis
2024-07-28 15:57   ` Jonathan Cameron
2024-08-21 21:51     ` Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 5/7] dt-bindings: iio: pressure: bmp085: Add interrupts for BMP3xx and BMP5xx devices Vasileios Amoiridis
2024-07-26  0:20   ` Rob Herring (Arm)
2024-07-25 23:10 ` [PATCH v2 6/7] iio: pressure: bmp280: Add data ready trigger support Vasileios Amoiridis
2024-07-28 16:06   ` Jonathan Cameron
2024-08-21 21:56     ` Vasileios Amoiridis
2024-07-25 23:10 ` [PATCH v2 7/7] iio: pressure bmp280: Move bmp085 interrupt to new configuration Vasileios Amoiridis
2024-07-26 10:41   ` kernel test robot
2024-07-27  0:29   ` kernel test robot
2024-07-28 16:09   ` Jonathan Cameron
2024-08-21 21:58     ` Vasileios Amoiridis [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=20240821215801.GB478206@vamoiridPC \
    --to=vassilisamir@gmail.com \
    --cc=579lpy@gmail.com \
    --cc=ak@it-klinger.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ang.iglesiasg@gmail.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=semen.protsenko@linaro.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