linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] power: fix bq27x00_battery kconfig
@ 2013-05-03  9:56 Xiong Zhou
  2013-05-03 10:06 ` Lars-Peter Clausen
  0 siblings, 1 reply; 6+ messages in thread
From: Xiong Zhou @ 2013-05-03  9:56 UTC (permalink / raw)
  To: anton, dwmw2; +Cc: linux-next, Stephen Rothwell, linux-kernel

From: Xiong Zhou <jencce.kernel@gmail.com>

This patch fixes build failure(randconfig) of next-20130501.
When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
BATTERY_BQ27x00 depends on I2C according to the code.

Failure message:
drivers/built-in.o: In function `bq27x00_read_i2c':
bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
drivers/built-in.o: In function `bq27x00_battery_init':
bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
drivers/built-in.o: In function `bq27x00_battery_exit':
bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
---
drivers/power/Kconfig |    1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 0d0b5d7..89e5ebd 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -152,6 +152,7 @@ config BATTERY_SBS
 
 config BATTERY_BQ27x00
 	tristate "BQ27x00 battery driver"
+	depends on I2C
 	help
 	  Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
 

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

* Re: [PATCH -next] power: fix bq27x00_battery kconfig
  2013-05-03  9:56 [PATCH -next] power: fix bq27x00_battery kconfig Xiong Zhou
@ 2013-05-03 10:06 ` Lars-Peter Clausen
  2013-05-04 10:11   ` zhou jencce
  0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-05-03 10:06 UTC (permalink / raw)
  To: Xiong Zhou; +Cc: anton, dwmw2, linux-next, Stephen Rothwell, linux-kernel

On 05/03/2013 11:56 AM, Xiong Zhou wrote:
> From: Xiong Zhou <jencce.kernel@gmail.com>
> 
> This patch fixes build failure(randconfig) of next-20130501.
> When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
> BATTERY_BQ27x00 depends on I2C according to the code.
> 

> Failure message:
> drivers/built-in.o: In function `bq27x00_read_i2c':
> bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
> drivers/built-in.o: In function `bq27x00_battery_init':
> bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
> bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
> drivers/built-in.o: In function `bq27x00_battery_exit':
> bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
> make: *** [vmlinux] Error 1
> 
> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>

It's actually a bit more tricky. The driver can be built without I2C
support, so it does not depend on I2C, but if I2C is built as a module the
driver should also only be built as a module.

I think the best solution is to put the platform code and the i2c code of
the bq27x00 driver each in their on module, but if you want a quick solution

depends on I2C || I2C=n

should work.

> ---
> drivers/power/Kconfig |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
> index 0d0b5d7..89e5ebd 100644
> --- a/drivers/power/Kconfig
> +++ b/drivers/power/Kconfig
> @@ -152,6 +152,7 @@ config BATTERY_SBS
>  
>  config BATTERY_BQ27x00
>  	tristate "BQ27x00 battery driver"
> +	depends on I2C
>  	help
>  	  Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH -next] power: fix bq27x00_battery kconfig
  2013-05-03 10:06 ` Lars-Peter Clausen
@ 2013-05-04 10:11   ` zhou jencce
  2013-05-04 10:28     ` Lars-Peter Clausen
  0 siblings, 1 reply; 6+ messages in thread
From: zhou jencce @ 2013-05-04 10:11 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: anton, dwmw2, linux-next, Stephen Rothwell, linux-kernel

2013/5/3 Lars-Peter Clausen <lars@metafoo.de>:
> On 05/03/2013 11:56 AM, Xiong Zhou wrote:
>> From: Xiong Zhou <jencce.kernel@gmail.com>
>>
>> This patch fixes build failure(randconfig) of next-20130501.
>> When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
>> BATTERY_BQ27x00 depends on I2C according to the code.
>>
>
>> Failure message:
>> drivers/built-in.o: In function `bq27x00_read_i2c':
>> bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
>> drivers/built-in.o: In function `bq27x00_battery_init':
>> bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
>> bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
>> drivers/built-in.o: In function `bq27x00_battery_exit':
>> bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
>> make: *** [vmlinux] Error 1
>>
>> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
>
> It's actually a bit more tricky. The driver can be built without I2C

What about the build error ?

> support, so it does not depend on I2C, but if I2C is built as a module the
> driver should also only be built as a module.

 And this is what this patch trying to do.

>
> I think the best solution is to put the platform code and the i2c code of
> the bq27x00 driver each in their on module, but if you want a quick solution

Yes, more clear.

>
> depends on I2C || I2C=n
>
> should work.
>

Thanks. :)

>> ---
>> drivers/power/Kconfig |    1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
>> index 0d0b5d7..89e5ebd 100644
>> --- a/drivers/power/Kconfig
>> +++ b/drivers/power/Kconfig
>> @@ -152,6 +152,7 @@ config BATTERY_SBS
>>
>>  config BATTERY_BQ27x00
>>       tristate "BQ27x00 battery driver"
>> +     depends on I2C
>>       help
>>         Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>

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

* Re: [PATCH -next] power: fix bq27x00_battery kconfig
  2013-05-04 10:11   ` zhou jencce
@ 2013-05-04 10:28     ` Lars-Peter Clausen
  2013-05-07  2:15       ` Xiong Zhou
  0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-05-04 10:28 UTC (permalink / raw)
  To: zhou jencce; +Cc: anton, dwmw2, linux-next, Stephen Rothwell, linux-kernel

On 05/04/2013 12:11 PM, zhou jencce wrote:
> 2013/5/3 Lars-Peter Clausen <lars@metafoo.de>:
>> On 05/03/2013 11:56 AM, Xiong Zhou wrote:
>>> From: Xiong Zhou <jencce.kernel@gmail.com>
>>>
>>> This patch fixes build failure(randconfig) of next-20130501.
>>> When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
>>> BATTERY_BQ27x00 depends on I2C according to the code.
>>>
>>
>>> Failure message:
>>> drivers/built-in.o: In function `bq27x00_read_i2c':
>>> bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
>>> drivers/built-in.o: In function `bq27x00_battery_init':
>>> bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
>>> bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
>>> drivers/built-in.o: In function `bq27x00_battery_exit':
>>> bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
>>> make: *** [vmlinux] Error 1
>>>
>>> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
>>
>> It's actually a bit more tricky. The driver can be built without I2C
> 
> What about the build error ?
> 

The built error only happens if the driver is built-in and I2C is built as a
module. Every other combination works fine. E.g. if I2C is disabled the
driver builds just fine. So the driver only depends on I2C if I2C is not
disabled.

>> support, so it does not depend on I2C, but if I2C is built as a module the
>> driver should also only be built as a module.
> 
>  And this is what this patch trying to do.
> 
>>
>> I think the best solution is to put the platform code and the i2c code of
>> the bq27x00 driver each in their on module, but if you want a quick solution
> 
> Yes, more clear.
> 
>>
>> depends on I2C || I2C=n
>>
>> should work.
>>
> 
> Thanks. :)
> 
>>> ---
>>> drivers/power/Kconfig |    1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
>>> index 0d0b5d7..89e5ebd 100644
>>> --- a/drivers/power/Kconfig
>>> +++ b/drivers/power/Kconfig
>>> @@ -152,6 +152,7 @@ config BATTERY_SBS
>>>
>>>  config BATTERY_BQ27x00
>>>       tristate "BQ27x00 battery driver"
>>> +     depends on I2C
>>>       help
>>>         Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>> Please read the FAQ at  http://www.tux.org/lkml/
>>

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

* Re: [PATCH -next] power: fix bq27x00_battery kconfig
  2013-05-04 10:28     ` Lars-Peter Clausen
@ 2013-05-07  2:15       ` Xiong Zhou
  2013-05-10 18:05         ` Anton Vorontsov
  0 siblings, 1 reply; 6+ messages in thread
From: Xiong Zhou @ 2013-05-07  2:15 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Xiong Zhou, anton, dwmw2, linux-next, Stephen Rothwell, linux-kernel

From: Xiong Zhou <jencce.kernel@gmail.com>

This patch fixes build failure(randconfig) of next-20130501.
When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
The driver depends on I2C only if I2C is not disabled, as Lars
commented. Last version of this patch make the driver depend on I2C
unconditionally.

Failure message:
drivers/built-in.o: In function `bq27x00_read_i2c':
bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
drivers/built-in.o: In function `bq27x00_battery_init':
bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
drivers/built-in.o: In function `bq27x00_battery_exit':
bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/power/Kconfig |    1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 0d0b5d7..f11bacd 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -152,6 +152,7 @@ config BATTERY_SBS
 
 config BATTERY_BQ27x00
 	tristate "BQ27x00 battery driver"
+	depends on I2C || I2C=n
 	help
 	  Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
 

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

* Re: [PATCH -next] power: fix bq27x00_battery kconfig
  2013-05-07  2:15       ` Xiong Zhou
@ 2013-05-10 18:05         ` Anton Vorontsov
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Vorontsov @ 2013-05-10 18:05 UTC (permalink / raw)
  To: Xiong Zhou
  Cc: Lars-Peter Clausen, dwmw2, linux-next, Stephen Rothwell, linux-kernel

On Tue, May 07, 2013 at 10:15:56AM +0800, Xiong Zhou wrote:
> From: Xiong Zhou <jencce.kernel@gmail.com>
> 
> This patch fixes build failure(randconfig) of next-20130501.
> When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure.
> The driver depends on I2C only if I2C is not disabled, as Lars
> commented. Last version of this patch make the driver depend on I2C
> unconditionally.
> 
> Failure message:
> drivers/built-in.o: In function `bq27x00_read_i2c':
> bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
> drivers/built-in.o: In function `bq27x00_battery_init':
> bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
> bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
> drivers/built-in.o: In function `bq27x00_battery_exit':
> bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
> make: *** [vmlinux] Error 1
> 
> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> ---

Applied, thanks!

> drivers/power/Kconfig |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
> index 0d0b5d7..f11bacd 100644
> --- a/drivers/power/Kconfig
> +++ b/drivers/power/Kconfig
> @@ -152,6 +152,7 @@ config BATTERY_SBS
>  
>  config BATTERY_BQ27x00
>  	tristate "BQ27x00 battery driver"
> +	depends on I2C || I2C=n
>  	help
>  	  Say Y here to enable support for batteries with BQ27x00 (I2C/HDQ) chips.
>  

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

end of thread, other threads:[~2013-05-10 18:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03  9:56 [PATCH -next] power: fix bq27x00_battery kconfig Xiong Zhou
2013-05-03 10:06 ` Lars-Peter Clausen
2013-05-04 10:11   ` zhou jencce
2013-05-04 10:28     ` Lars-Peter Clausen
2013-05-07  2:15       ` Xiong Zhou
2013-05-10 18:05         ` Anton Vorontsov

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).