power: supply: ucs1002: Fix build error without CONFIG_REGULATOR
diff mbox series

Message ID 20190510071823.2984-1-yuehaibing@huawei.com
State Not Applicable, archived
Headers show
Series
  • power: supply: ucs1002: Fix build error without CONFIG_REGULATOR
Related show

Commit Message

YueHaibing May 10, 2019, 7:18 a.m. UTC
Fix gcc build error while CONFIG_REGULATOR is not set

drivers/power/supply/ucs1002_power.o: In function `ucs1002_probe':
drivers/power/supply/ucs1002_power.c:593: undefined reference to `devm_regulator_register'
drivers/power/supply/ucs1002_power.o:(.rodata+0x3b8): undefined reference to `regulator_enable_regmap'
drivers/power/supply/ucs1002_power.o:(.rodata+0x3c0): undefined reference to `regulator_disable_regmap'
drivers/power/supply/ucs1002_power.o:(.rodata+0x3c8): undefined reference to `regulator_is_enabled_regmap'

Add Kconfig dependency to CONFIG_REGULATOR.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/power/supply/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck May 10, 2019, 1:05 p.m. UTC | #1
On 5/10/19 12:18 AM, YueHaibing wrote:
> Fix gcc build error while CONFIG_REGULATOR is not set
> 
> drivers/power/supply/ucs1002_power.o: In function `ucs1002_probe':
> drivers/power/supply/ucs1002_power.c:593: undefined reference to `devm_regulator_register'
> drivers/power/supply/ucs1002_power.o:(.rodata+0x3b8): undefined reference to `regulator_enable_regmap'
> drivers/power/supply/ucs1002_power.o:(.rodata+0x3c0): undefined reference to `regulator_disable_regmap'
> drivers/power/supply/ucs1002_power.o:(.rodata+0x3c8): undefined reference to `regulator_is_enabled_regmap'
> 
> Add Kconfig dependency to CONFIG_REGULATOR.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/power/supply/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index ef36bd2..26dacda 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -682,6 +682,7 @@ config CHARGER_UCS1002
>   	tristate "Microchip UCS1002 USB Port Power Controller"
>   	depends on I2C
>   	depends on OF
> +	depends on REGULATOR
>   	select REGMAP_I2C
>   	help
>   	  Say Y to enable support for Microchip UCS1002 Programmable
>
Sebastian Reichel May 10, 2019, 4:22 p.m. UTC | #2
Hi,

On Fri, May 10, 2019 at 06:05:06AM -0700, Guenter Roeck wrote:
> On 5/10/19 12:18 AM, YueHaibing wrote:
> > Fix gcc build error while CONFIG_REGULATOR is not set
> > 
> > drivers/power/supply/ucs1002_power.o: In function `ucs1002_probe':
> > drivers/power/supply/ucs1002_power.c:593: undefined reference to `devm_regulator_register'
> > drivers/power/supply/ucs1002_power.o:(.rodata+0x3b8): undefined reference to `regulator_enable_regmap'
> > drivers/power/supply/ucs1002_power.o:(.rodata+0x3c0): undefined reference to `regulator_disable_regmap'
> > drivers/power/supply/ucs1002_power.o:(.rodata+0x3c8): undefined reference to `regulator_is_enabled_regmap'
> > 
> > Add Kconfig dependency to CONFIG_REGULATOR.
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Fixes: 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Thanks, queued.

-- Sebastian

Patch
diff mbox series

diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index ef36bd2..26dacda 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -682,6 +682,7 @@  config CHARGER_UCS1002
 	tristate "Microchip UCS1002 USB Port Power Controller"
 	depends on I2C
 	depends on OF
+	depends on REGULATOR
 	select REGMAP_I2C
 	help
 	  Say Y to enable support for Microchip UCS1002 Programmable