Re: [PATCH] extcon: Fix build issues in ptn5150

From: Randy Dunlap
Date: Mon Jan 28 2019 - 16:26:54 EST


On 1/27/19 11:10 PM, Vijai Kumar K wrote:
> On Mon, Jan 28, 2019 at 10:08:12AM +0530, Vijai Kumar K wrote:
> I was wondering, what is the normal procedure in the below case
> when the build fails because of the driver.
> Should I send a new patch as a whole [PATCH v3] for the driver
> or should I send a new patch to fix the issue like below.

Hi,

I think that's up to the maintainer who merged the version that is
currently in linux-next.

For the patch:
Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Thanks.

> Thanks,
> Vijai Kumar K
>> - extcon-ptn5150 driver uses gpio libraries
>> - Add GPIOLIB in depends section of Kconfig
>>
>> Error:
>> -----
>>> CC drivers/extcon/extcon-ptn5150.o
>>> ../drivers/extcon/extcon-ptn5150.c: In function âptn5150_irq_workâ:
>>> ../drivers/extcon/extcon-ptn5150.c:130:5: error: implicit declaration of function âgpiod_set_valueâ [-Werror=implicit-function-declaration]
>>> gpiod_set_value(info->vbus_gpiod, 0);
>>> ^
>>> ../drivers/extcon/extcon-ptn5150.c: In function âptn5150_i2c_probeâ:
>>> ../drivers/extcon/extcon-ptn5150.c:242:2: error: implicit declaration of function âdevm_gpiod_getâ [-Werror=implicit-function-declaration]
>>> info->int_gpiod = devm_gpiod_get(&i2c->dev, "int", GPIOD_IN);
>>> ^
>>> ../drivers/extcon/extcon-ptn5150.c:242:53: error: âGPIOD_INâ undeclared (first use in this function)
>>> info->int_gpiod = devm_gpiod_get(&i2c->dev, "int", GPIOD_IN);
>>> ^
>>> ../drivers/extcon/extcon-ptn5150.c:242:53: note: each undeclared identifier is reported only once for each function it appears in
>>> ../drivers/extcon/extcon-ptn5150.c:252:2: error: implicit declaration of function âgpiod_direction_outputâ [-Werror=implicit-function-declaration]
>>> ret = gpiod_direction_output(info->vbus_gpiod, 0);
>>> ^
>>> ../drivers/extcon/extcon-ptn5150.c:271:3: error: implicit declaration of function âgpiod_to_irqâ [-Werror=implicit-function-declaration]
>>> info->irq = gpiod_to_irq(info->int_gpiod);
>> -----
>>
>> Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@xxxxxxxxx>
>> ---
>> drivers/extcon/Kconfig | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
>> index b9cc027..330dd8b 100644
>> --- a/drivers/extcon/Kconfig
>> +++ b/drivers/extcon/Kconfig
>> @@ -116,7 +116,7 @@ config EXTCON_PALMAS
>>
>> config EXTCON_PTN5150
>> tristate "NXP PTN5150 CC LOGIC USB EXTCON support"
>> - depends on I2C
>> + depends on I2C && GPIOLIB
>> select REGMAP_I2C
>> help
>> Say Y here to enable support for USB peripheral and USB host
>> --
>> 2.7.4
>>


--
~Randy