Skip to contentSkip to conversation

iio: humidity: am2315: Select IIO_TRIGGERED_BUFFER to prevent build errors

PATCH In review Mika Westerberg 2 participants 2 messages Aug 18, 2016 – Aug 21, 2016 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: humidity: am2315: Select IIO_TRIGGERED_BUFFER to prevent build errors

Commit 0d96d5ead3f7 ("iio: humidity: Add triggered buffer support for AM2315") added support for triggered buffers but those are only available when IIO_TRIGGERED_BUFFER is selected. Currently we get warnings like:

drivers/iio/humidity/am2315.c: In function ‘am2315_trigger_handler’:
drivers/iio/humidity/am2315.c:186:2: error: implicit declaration of function

    ‘iio_push_to_buffers_with_timestamp’ [-Werror=implicit-function-declaration]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors
scripts/Makefile.build:289: recipe for target 'drivers/iio/humidity/am2315.o' failed

Furthermore linking the kernel executable fails because triggered buffer functions are never build.

Fix this by selecting IIO_TRIGGERED_BUFFER and IIO_BUFFER when the driver is enabled.

---
 drivers/iio/humidity/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/humidity/Kconfig +2 -0
index 738a86d9e4a9..d04124345992 100644
@@ -6,6 +6,8 @@ menu "Humidity sensors"
 config AM2315
     tristate "Aosong AM2315 relative humidity and temperature sensor"
     depends on I2C
+    select IIO_BUFFER
+    select IIO_TRIGGERED_BUFFER
     help
       If you say yes here you get support for the Aosong AM2315
       relative humidity and ambient temperature sensor.
Signature · 1 line
2.8.1
maintainer
#1 lore raw
Quoted 11 lines · Mika Westerberg

Commit 0d96d5ead3f7 ("iio: humidity: Add triggered buffer support for AM2315") added support for triggered buffers but those are only available when IIO_TRIGGERED_BUFFER is selected. Currently we get warnings like:

drivers/iio/humidity/am2315.c: In function ‘am2315_trigger_handler’:
drivers/iio/humidity/am2315.c:186:2: error: implicit declaration of function

    ‘iio_push_to_buffers_with_timestamp’ [-Werror=implicit-function-declaration]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors
scripts/Makefile.build:289: recipe for target 'drivers/iio/humidity/am2315.o' failed

Quoted 7 lines

Furthermore linking the kernel executable fails because triggered buffer functions are never build.

Fix this by selecting IIO_TRIGGERED_BUFFER and IIO_BUFFER when the driver is enabled.

Hi Mika,

I already have a patch queued up for this bug. Just been on holiday so running a bit behind with getting things upstream. Should go in the next few days.

Jonathan

Quoted 18 lines
---
 drivers/iio/humidity/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/humidity/Kconfig +2 -0
index 738a86d9e4a9..d04124345992 100644
@@ -6,6 +6,8 @@ menu "Humidity sensors"
 config AM2315
     tristate "Aosong AM2315 relative humidity and temperature sensor"
     depends on I2C
+    select IIO_BUFFER
+    select IIO_TRIGGERED_BUFFER
     help
       If you say yes here you get support for the Aosong AM2315
       relative humidity and ambient temperature sensor.