Skip to contentSkip to conversation

iio: gyro: mpu3050: remove duplicate initializer

PATCH Applied Arnd Bergmann 3 participants 6 messages Nov 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 iio: gyro: mpu3050: remove duplicate initializer

The newly added mpu3050 driver has two initializations for the module owner, which causes a warning for 'make W=1':

include/linux/export.h:37:21: error: initialized field overwritten [-Werror=override-init] drivers/iio/gyro/mpu3050-core.c:749:19: note: in expansion of macro 'THIS_MODULE'

This removes one of the two.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")
---
 drivers/iio/gyro/mpu3050-core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/gyro/mpu3050-core.c +0 -1
index ed681c70a7b4..2be2a5d287e6 100644
@@ -746,7 +746,6 @@ static const struct iio_info mpu3050_info = {
 	.read_raw = mpu3050_read_raw,
 	.write_raw = mpu3050_write_raw,
 	.attrs = &mpu3050_attribute_group,
-	.driver_module = THIS_MODULE,
 };
 
 /**
Signature · 1 line
2.9.0
#1 lore raw

PATCH 2/2 iio: gyro: mpu3050: add I2C dependency

The new mpu3050 driver fails to build if I2C is disabled:

drivers/iio/built-in.o: In function `mpu3050_i2c_driver_exit':
mpu3050-i2c.c:(.exit.text+0x17f): undefined reference to i2c_del_driver' drivers/iio/built-in.o: In function mpu3050_i2c_driver_init':
mpu3050-i2c.c:(.init.text+0x215): undefined reference to `i2c_register_driver'

This adds a Kconfig dependency to ensure we only build it when I2C is available.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")
---
 drivers/iio/gyro/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/gyro/Kconfig +1 -0
index 107b5efd4178..3126cf05e6b9 100644
@@ -93,6 +93,7 @@ config MPU3050
 config MPU3050_I2C
 	tristate "Invensense MPU3050 devices on I2C"
 	depends on !(INPUT_MPU3050=y || INPUT_MPU3050=m)
+	depends on I2C
 	select MPU3050
 	select REGMAP_I2C
 	select I2C_MUX
Signature · 1 line
2.9.0
Acked-by on v1 1/2
#4 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

The newly added mpu3050 driver has two initializations for the module owner, which causes a warning for 'make W=1':

include/linux/export.h:37:21: error: initialized field overwritten [-Werror=override-init] drivers/iio/gyro/mpu3050-core.c:749:19: note: in expansion of macro 'THIS_MODULE'

This removes one of the two.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")

Yours,
Linus Walleij

Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency

In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

The new mpu3050 driver fails to build if I2C is disabled:

drivers/iio/built-in.o: In function `mpu3050_i2c_driver_exit':
mpu3050-i2c.c:(.exit.text+0x17f): undefined reference to i2c_del_driver' drivers/iio/built-in.o: In function mpu3050_i2c_driver_init':
mpu3050-i2c.c:(.init.text+0x215): undefined reference to `i2c_register_driver'

Quoted 5 lines

This adds a Kconfig dependency to ensure we only build it when I2C is available.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")

Yours,
Linus Walleij

maintainer
#5 lore raw
In reply to Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 6 lines · Arnd Bergmann

The newly added mpu3050 driver has two initializations for the module owner, which causes a warning for 'make W=1':

include/linux/export.h:37:21: error: initialized field overwritten [-Werror=override-init] drivers/iio/gyro/mpu3050-core.c:749:19: note: in expansion of macro 'THIS_MODULE'

Quoted 6 lines
Quoted 4 lines

This removes one of the two.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")

Applied to the togreg branch of iio.git. Initially pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 4 lines

Yours,
Linus Walleij

maintainer Applied
#3 lore raw

Re: [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency

In reply to Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Arnd Bergmann

The new mpu3050 driver fails to build if I2C is disabled:

drivers/iio/built-in.o: In function `mpu3050_i2c_driver_exit':
mpu3050-i2c.c:(.exit.text+0x17f): undefined reference to i2c_del_driver' drivers/iio/built-in.o: In function mpu3050_i2c_driver_init':
mpu3050-i2c.c:(.init.text+0x215): undefined reference to `i2c_register_driver'

Quoted 7 lines
Quoted 5 lines

This adds a Kconfig dependency to ensure we only build it when I2C is available.

Fixes 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")

Applied. Thanks.

Jonathan

Quoted 8 lines

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html