lkml.org 
[lkml]   [2023]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: bmp280: fix eoc interrupt usage
On Wed, Oct 18, 2023 at 05:28:16PM +0200, Andreas Klinger wrote:
> Only the bmp085 can have an End-Of-Conversion (EOC) interrupt. But the
> bmp085 and bmp180 share the same chip id. Therefore it's necessary to
> distinguish the case in which the interrupt is set.
>
> Fix the if statement so that only when the interrupt is set and the chip
> id is recognized the interrupt is requested.
>
> This bug exists since the support of EOC interrupt was introduced.
> Fixes: aae953949651 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt")
>
> Also add a link to bmp085 datasheet for reference.

...

> - if (irq > 0 || (chip_id == BMP180_CHIP_ID)) {
> + if (irq > 0 && (chip_id == BMP180_CHIP_ID)) {

While at it, perhaps drop extra space?

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-10-18 17:52    [W:0.069 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site