2021-01-16 21:17:55

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH] power: supply: fix sbs-charger build, needs REGMAP_I2C

CHARGER_SBS should select REGMAP_I2C since it uses API(s) that are
provided by that Kconfig symbol.

Fixes these errors:

../drivers/power/supply/sbs-charger.c:149:21: error: variable ‘sbs_regmap’ has initializer but incomplete type
static const struct regmap_config sbs_regmap = {
../drivers/power/supply/sbs-charger.c:150:3: error: ‘const struct regmap_config’ has no member named ‘reg_bits’
.reg_bits = 8,
../drivers/power/supply/sbs-charger.c:155:23: error: ‘REGMAP_ENDIAN_LITTLE’ undeclared here (not in a function)
.val_format_endian = REGMAP_ENDIAN_LITTLE, /* since based on SMBus */
../drivers/power/supply/sbs-charger.c: In function ‘sbs_probe’:
../drivers/power/supply/sbs-charger.c:183:17: error: implicit declaration of function ‘devm_regmap_init_i2c’; did you mean ‘devm_request_irq’? [-Werror=implicit-function-declaration]
chip->regmap = devm_regmap_init_i2c(client, &sbs_regmap);
../drivers/power/supply/sbs-charger.c: At top level:
../drivers/power/supply/sbs-charger.c:149:35: error: storage size of ‘sbs_regmap’ isn’t known
static const struct regmap_config sbs_regmap = {

Fixes: feb583e37f8a ("power: supply: add sbs-charger driver")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]
Cc: Martin Mokrejs <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: Nicolas Saenz Julienne <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
---
Martin, do you want Reported-by: on this?

drivers/power/supply/Kconfig | 1 +
1 file changed, 1 insertion(+)

--- linux-next-20210115.orig/drivers/power/supply/Kconfig
+++ linux-next-20210115/drivers/power/supply/Kconfig
@@ -229,6 +229,7 @@ config BATTERY_SBS
config CHARGER_SBS
tristate "SBS Compliant charger"
depends on I2C
+ select REGMAP_I2C
help
Say Y to include support for SBS compliant battery chargers.


2021-01-17 09:59:18

by Martin Mokrejs

[permalink] [raw]
Subject: Re: [PATCH] power: supply: fix sbs-charger build, needs REGMAP_I2C

Hi Randy,
thank you very much. I would not mind dropping my name but I tested the patch
now with 5.4.89 so you may actually also add

Tested-by: Martin Mokrejs <[email protected]>

It also happened with 5.10.7, it is probably obvious.

Thank you for quick action.
Martin

On 16/01/2021 22:13, Randy Dunlap wrote:
> CHARGER_SBS should select REGMAP_I2C since it uses API(s) that are
> provided by that Kconfig symbol.
>
> Fixes these errors:
>
> ../drivers/power/supply/sbs-charger.c:149:21: error: variable ‘sbs_regmap’ has initializer but incomplete type
> static const struct regmap_config sbs_regmap = {
> ../drivers/power/supply/sbs-charger.c:150:3: error: ‘const struct regmap_config’ has no member named ‘reg_bits’
> .reg_bits = 8,
> ../drivers/power/supply/sbs-charger.c:155:23: error: ‘REGMAP_ENDIAN_LITTLE’ undeclared here (not in a function)
> .val_format_endian = REGMAP_ENDIAN_LITTLE, /* since based on SMBus */
> ../drivers/power/supply/sbs-charger.c: In function ‘sbs_probe’:
> ../drivers/power/supply/sbs-charger.c:183:17: error: implicit declaration of function ‘devm_regmap_init_i2c’; did you mean ‘devm_request_irq’? [-Werror=implicit-function-declaration]
> chip->regmap = devm_regmap_init_i2c(client, &sbs_regmap);
> ../drivers/power/supply/sbs-charger.c: At top level:
> ../drivers/power/supply/sbs-charger.c:149:35: error: storage size of ‘sbs_regmap’ isn’t known
> static const struct regmap_config sbs_regmap = {
>
> Fixes: feb583e37f8a ("power: supply: add sbs-charger driver")
> Signed-off-by: Randy Dunlap <[email protected]>
> Cc: Sebastian Reichel <[email protected]>
> Cc: [email protected]
> Cc: Martin Mokrejs <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Cc: Nicolas Saenz Julienne <[email protected]>
> Cc: Rafael J. Wysocki <[email protected]>
> ---
> Martin, do you want Reported-by: on this?
>
> drivers/power/supply/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> --- linux-next-20210115.orig/drivers/power/supply/Kconfig
> +++ linux-next-20210115/drivers/power/supply/Kconfig
> @@ -229,6 +229,7 @@ config BATTERY_SBS
> config CHARGER_SBS
> tristate "SBS Compliant charger"
> depends on I2C
> + select REGMAP_I2C
> help
> Say Y to include support for SBS compliant battery chargers.
>
>

2021-01-17 18:23:21

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH] power: supply: fix sbs-charger build, needs REGMAP_I2C

Hi,

On Sun, Jan 17, 2021 at 10:48:44AM +0100, Martin Mokrejs wrote:
> Hi Randy,
> thank you very much. I would not mind dropping my name but I tested the patch
> now with 5.4.89 so you may actually also add
>
> Tested-by: Martin Mokrejs <[email protected]>
>
> It also happened with 5.10.7, it is probably obvious.
>
> Thank you for quick action.
> Martin
>
> On 16/01/2021 22:13, Randy Dunlap wrote:
> > CHARGER_SBS should select REGMAP_I2C since it uses API(s) that are
> > provided by that Kconfig symbol.
> >
> > Fixes these errors:
> >
> > ../drivers/power/supply/sbs-charger.c:149:21: error: variable ‘sbs_regmap’ has initializer but incomplete type
> > static const struct regmap_config sbs_regmap = {
> > ../drivers/power/supply/sbs-charger.c:150:3: error: ‘const struct regmap_config’ has no member named ‘reg_bits’
> > .reg_bits = 8,
> > ../drivers/power/supply/sbs-charger.c:155:23: error: ‘REGMAP_ENDIAN_LITTLE’ undeclared here (not in a function)
> > .val_format_endian = REGMAP_ENDIAN_LITTLE, /* since based on SMBus */
> > ../drivers/power/supply/sbs-charger.c: In function ‘sbs_probe’:
> > ../drivers/power/supply/sbs-charger.c:183:17: error: implicit declaration of function ‘devm_regmap_init_i2c’; did you mean ‘devm_request_irq’? [-Werror=implicit-function-declaration]
> > chip->regmap = devm_regmap_init_i2c(client, &sbs_regmap);
> > ../drivers/power/supply/sbs-charger.c: At top level:
> > ../drivers/power/supply/sbs-charger.c:149:35: error: storage size of ‘sbs_regmap’ isn’t known
> > static const struct regmap_config sbs_regmap = {
> >
> > Fixes: feb583e37f8a ("power: supply: add sbs-charger driver")
> > Signed-off-by: Randy Dunlap <[email protected]>
> > Cc: Sebastian Reichel <[email protected]>
> > Cc: [email protected]
> > Cc: Martin Mokrejs <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: [email protected]
> > Cc: Nicolas Saenz Julienne <[email protected]>
> > Cc: Rafael J. Wysocki <[email protected]>
> > ---
> > Martin, do you want Reported-by: on this?

Thanks, queued. I added Reported-by and Tested-by from Martin.

-- Sebastian

> >
> > drivers/power/supply/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > --- linux-next-20210115.orig/drivers/power/supply/Kconfig
> > +++ linux-next-20210115/drivers/power/supply/Kconfig
> > @@ -229,6 +229,7 @@ config BATTERY_SBS
> > config CHARGER_SBS
> > tristate "SBS Compliant charger"
> > depends on I2C
> > + select REGMAP_I2C
> > help
> > Say Y to include support for SBS compliant battery chargers.
> >
> >
>


Attachments:
(No filename) (2.66 kB)
signature.asc (849.00 B)
Download all attachments