linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer
@ 2016-11-08 13:59 Arnd Bergmann
  2016-11-08 13:59 ` [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency Arnd Bergmann
  2016-11-08 15:39 ` [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-11-08 13:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Linus Walleij, Arnd Bergmann, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iio/gyro/mpu3050-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index ed681c70a7b4..2be2a5d287e6 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -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,
 };
 
 /**
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency
  2016-11-08 13:59 [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Arnd Bergmann
@ 2016-11-08 13:59 ` Arnd Bergmann
  2016-11-08 15:40   ` Linus Walleij
  2016-11-08 15:39 ` [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2016-11-08 13:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Linus Walleij, Arnd Bergmann, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iio/gyro/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig
index 107b5efd4178..3126cf05e6b9 100644
--- a/drivers/iio/gyro/Kconfig
+++ b/drivers/iio/gyro/Kconfig
@@ -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
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer
  2016-11-08 13:59 [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Arnd Bergmann
  2016-11-08 13:59 ` [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency Arnd Bergmann
@ 2016-11-08 15:39 ` Linus Walleij
  2016-11-08 20:29   ` Jonathan Cameron
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2016-11-08 15:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On Tue, Nov 8, 2016 at 2:59 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency
  2016-11-08 13:59 ` [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency Arnd Bergmann
@ 2016-11-08 15:40   ` Linus Walleij
  2016-11-08 20:29     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2016-11-08 15:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On Tue, Nov 8, 2016 at 2:59 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer
  2016-11-08 15:39 ` [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Linus Walleij
@ 2016-11-08 20:29   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2016-11-08 20:29 UTC (permalink / raw)
  To: Linus Walleij, Arnd Bergmann
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On 08/11/16 15:39, Linus Walleij wrote:
> On Tue, Nov 8, 2016 at 2:59 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
>> 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")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Applied to the togreg branch of iio.git. Initially pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan
> 
> Yours,
> Linus Walleij
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency
  2016-11-08 15:40   ` Linus Walleij
@ 2016-11-08 20:29     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2016-11-08 20:29 UTC (permalink / raw)
  To: Linus Walleij, Arnd Bergmann
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On 08/11/16 15:40, Linus Walleij wrote:
> On Tue, Nov 8, 2016 at 2:59 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
>> 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")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Applied.  Thanks.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-08 20:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 13:59 [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Arnd Bergmann
2016-11-08 13:59 ` [PATCH 2/2] iio: gyro: mpu3050: add I2C dependency Arnd Bergmann
2016-11-08 15:40   ` Linus Walleij
2016-11-08 20:29     ` Jonathan Cameron
2016-11-08 15:39 ` [PATCH 1/2] iio: gyro: mpu3050: remove duplicate initializer Linus Walleij
2016-11-08 20:29   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).