lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240821215801.GB478206@vamoiridPC>
Date: Wed, 21 Aug 2024 23:58:01 +0200
From: Vasileios Amoiridis <vassilisamir@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Vasileios Amoiridis <vassilisamir@...il.com>, lars@...afoo.de,
	robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
	andriy.shevchenko@...ux.intel.com, ang.iglesiasg@...il.com,
	linus.walleij@...aro.org, biju.das.jz@...renesas.com,
	javier.carrasco.cruz@...il.com, semen.protsenko@...aro.org,
	579lpy@...il.com, ak@...klinger.de, linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 7/7] iio: pressure bmp280: Move bmp085 interrupt to
 new configuration

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@...il.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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ