2019-12-12 07:39:35

by zhong jiang

[permalink] [raw]
Subject: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

Fixes the following compile error:

drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
make: *** [vmlinux] Error 1

Signed-off-by: zhong jiang <[email protected]>
---
drivers/usb/typec/tcpm/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
index 72481bb..a81ea9f 100644
--- a/drivers/usb/typec/tcpm/Kconfig
+++ b/drivers/usb/typec/tcpm/Kconfig
@@ -32,6 +32,7 @@ endif # TYPEC_TCPCI
config TYPEC_FUSB302
tristate "Fairchild FUSB302 Type-C chip driver"
depends on I2C
+ depends on EXTCON
help
The Fairchild FUSB302 Type-C chip driver that works with
Type-C Port Controller Manager to provide USB PD and USB
--
1.7.12.4


2019-12-12 09:02:28

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> Fixes the following compile error:
>
> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> make: *** [vmlinux] Error 1

There are stubs for those functions so that really should not be
happening. I can not reproduce that.

thanks,

--
heikki

2019-12-12 09:16:20

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On 2019/12/12 17:01, Heikki Krogerus wrote:
> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
>> Fixes the following compile error:
>>
>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
>> make: *** [vmlinux] Error 1
> There are stubs for those functions so that really should not be
> happening. I can not reproduce that.
It can be reproduced in next branch. you can try it in the latest next branch.

Thanks,
zhong jiang
> thanks,
>


2019-12-12 09:29:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
> On 2019/12/12 17:01, Heikki Krogerus wrote:
> > On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> >> Fixes the following compile error:
> >>
> >> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> >> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> >> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> >> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> >> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> >> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> >> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> >> make: *** [vmlinux] Error 1
> > There are stubs for those functions so that really should not be
> > happening. I can not reproduce that.
> It can be reproduced in next branch. you can try it in the latest next branch.

Can it be reproduced in 5.5-rc1?

2019-12-12 09:37:38

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On 2019/12/12 17:28, Greg KH wrote:
> On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
>> On 2019/12/12 17:01, Heikki Krogerus wrote:
>>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
>>>> Fixes the following compile error:
>>>>
>>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
>>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
>>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
>>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
>>>> make: *** [vmlinux] Error 1
>>> There are stubs for those functions so that really should not be
>>> happening. I can not reproduce that.
>> It can be reproduced in next branch. you can try it in the latest next branch.
> Can it be reproduced in 5.5-rc1?
Yes
> .
>


2019-12-12 09:41:37

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On 2019/12/12 17:28, Greg KH wrote:
> On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
>> On 2019/12/12 17:01, Heikki Krogerus wrote:
>>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
>>>> Fixes the following compile error:
>>>>
>>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
>>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
>>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
>>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
>>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
>>>> make: *** [vmlinux] Error 1
>>> There are stubs for those functions so that really should not be
>>> happening. I can not reproduce that.
>> It can be reproduced in next branch. you can try it in the latest next branch.
> Can it be reproduced in 5.5-rc1?
>
commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
Author: Stephen Rothwell <[email protected]>
Date: Thu Dec 12 15:48:07 2019 +1100

Add linux-next specific files for 20191212

I reproduce it based on this commit. The related config is attached.
>


Attachments:
.config (145.44 kB)

2019-12-12 11:20:43

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 05:40:40PM +0800, zhong jiang wrote:
> On 2019/12/12 17:28, Greg KH wrote:
> > On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
> >> On 2019/12/12 17:01, Heikki Krogerus wrote:
> >>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> >>>> Fixes the following compile error:
> >>>>
> >>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> >>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> >>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> >>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> >>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> >>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> >>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> >>>> make: *** [vmlinux] Error 1
> >>> There are stubs for those functions so that really should not be
> >>> happening. I can not reproduce that.
> >> It can be reproduced in next branch. you can try it in the latest next branch.
> > Can it be reproduced in 5.5-rc1?
> >
> commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
> Author: Stephen Rothwell <[email protected]>
> Date: Thu Dec 12 15:48:07 2019 +1100
>
> Add linux-next specific files for 20191212
>
> I reproduce it based on this commit. The related config is attached.

OK, now I get what's going on. EXTCON is build as a module, but
FUSB302 is not. This should be explained in the commit message.

That does not mean we have to force everybody to enable EXTCON in
order to use this driver. Try something like this:

diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
index 72481bbb2af3..06e026f6325c 100644
--- a/drivers/usb/typec/tcpm/Kconfig
+++ b/drivers/usb/typec/tcpm/Kconfig
@@ -31,6 +31,7 @@ endif # TYPEC_TCPCI

config TYPEC_FUSB302
tristate "Fairchild FUSB302 Type-C chip driver"
+ depends on EXTCON=n || EXTCON=y || (EXTCON=m && m)
depends on I2C
help
The Fairchild FUSB302 Type-C chip driver that works with


It looks a bit silly, but I don't know of any other way (maybe
somebody else does?).

thanks,

--
heikki

2019-12-12 12:21:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 01:18:05PM +0200, Heikki Krogerus wrote:
> On Thu, Dec 12, 2019 at 05:40:40PM +0800, zhong jiang wrote:
> > On 2019/12/12 17:28, Greg KH wrote:
> > > On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
> > >> On 2019/12/12 17:01, Heikki Krogerus wrote:
> > >>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> > >>>> Fixes the following compile error:
> > >>>>
> > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> > >>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> > >>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> > >>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> > >>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> > >>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> > >>>> make: *** [vmlinux] Error 1
> > >>> There are stubs for those functions so that really should not be
> > >>> happening. I can not reproduce that.
> > >> It can be reproduced in next branch. you can try it in the latest next branch.
> > > Can it be reproduced in 5.5-rc1?
> > >
> > commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
> > Author: Stephen Rothwell <[email protected]>
> > Date: Thu Dec 12 15:48:07 2019 +1100
> >
> > Add linux-next specific files for 20191212
> >
> > I reproduce it based on this commit. The related config is attached.
>
> OK, now I get what's going on. EXTCON is build as a module, but
> FUSB302 is not. This should be explained in the commit message.
>
> That does not mean we have to force everybody to enable EXTCON in
> order to use this driver. Try something like this:
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 72481bbb2af3..06e026f6325c 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -31,6 +31,7 @@ endif # TYPEC_TCPCI
>
> config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> + depends on EXTCON=n || EXTCON=y || (EXTCON=m && m)

Ugh. We need a better "pattern" for stuff like this, it's getting more
and more frequent.

And no, I don't have a better idea :(

thanks,

greg k-h

2019-12-12 12:50:27

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 01:20:53PM +0100, Greg KH wrote:
> On Thu, Dec 12, 2019 at 01:18:05PM +0200, Heikki Krogerus wrote:
> > On Thu, Dec 12, 2019 at 05:40:40PM +0800, zhong jiang wrote:
> > > On 2019/12/12 17:28, Greg KH wrote:
> > > > On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
> > > >> On 2019/12/12 17:01, Heikki Krogerus wrote:
> > > >>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> > > >>>> Fixes the following compile error:
> > > >>>>
> > > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> > > >>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> > > >>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> > > >>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> > > >>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> > > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> > > >>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> > > >>>> make: *** [vmlinux] Error 1
> > > >>> There are stubs for those functions so that really should not be
> > > >>> happening. I can not reproduce that.
> > > >> It can be reproduced in next branch. you can try it in the latest next branch.
> > > > Can it be reproduced in 5.5-rc1?
> > > >
> > > commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
> > > Author: Stephen Rothwell <[email protected]>
> > > Date: Thu Dec 12 15:48:07 2019 +1100
> > >
> > > Add linux-next specific files for 20191212
> > >
> > > I reproduce it based on this commit. The related config is attached.
> >
> > OK, now I get what's going on. EXTCON is build as a module, but
> > FUSB302 is not. This should be explained in the commit message.
> >
> > That does not mean we have to force everybody to enable EXTCON in
> > order to use this driver. Try something like this:
> >
> > diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> > index 72481bbb2af3..06e026f6325c 100644
> > --- a/drivers/usb/typec/tcpm/Kconfig
> > +++ b/drivers/usb/typec/tcpm/Kconfig
> > @@ -31,6 +31,7 @@ endif # TYPEC_TCPCI
> >
> > config TYPEC_FUSB302
> > tristate "Fairchild FUSB302 Type-C chip driver"
> > + depends on EXTCON=n || EXTCON=y || (EXTCON=m && m)
>
> Ugh. We need a better "pattern" for stuff like this, it's getting more
> and more frequent.
>
> And no, I don't have a better idea :(

I think this works:

depends on EXTCON || !EXTCON

thanks,

--
heikki

2019-12-12 14:21:23

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On 2019/12/12 20:49, Heikki Krogerus wrote:
> On Thu, Dec 12, 2019 at 01:20:53PM +0100, Greg KH wrote:
>> On Thu, Dec 12, 2019 at 01:18:05PM +0200, Heikki Krogerus wrote:
>>> On Thu, Dec 12, 2019 at 05:40:40PM +0800, zhong jiang wrote:
>>>> On 2019/12/12 17:28, Greg KH wrote:
>>>>> On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
>>>>>> On 2019/12/12 17:01, Heikki Krogerus wrote:
>>>>>>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
>>>>>>>> Fixes the following compile error:
>>>>>>>>
>>>>>>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
>>>>>>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
>>>>>>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
>>>>>>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
>>>>>>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
>>>>>>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
>>>>>>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
>>>>>>>> make: *** [vmlinux] Error 1
>>>>>>> There are stubs for those functions so that really should not be
>>>>>>> happening. I can not reproduce that.
>>>>>> It can be reproduced in next branch. you can try it in the latest next branch.
>>>>> Can it be reproduced in 5.5-rc1?
>>>>>
>>>> commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
>>>> Author: Stephen Rothwell <[email protected]>
>>>> Date: Thu Dec 12 15:48:07 2019 +1100
>>>>
>>>> Add linux-next specific files for 20191212
>>>>
>>>> I reproduce it based on this commit. The related config is attached.
>>> OK, now I get what's going on. EXTCON is build as a module, but
>>> FUSB302 is not. This should be explained in the commit message.
>>>
>>> That does not mean we have to force everybody to enable EXTCON in
>>> order to use this driver. Try something like this:
>>>
>>> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
>>> index 72481bbb2af3..06e026f6325c 100644
>>> --- a/drivers/usb/typec/tcpm/Kconfig
>>> +++ b/drivers/usb/typec/tcpm/Kconfig
>>> @@ -31,6 +31,7 @@ endif # TYPEC_TCPCI
>>>
>>> config TYPEC_FUSB302
>>> tristate "Fairchild FUSB302 Type-C chip driver"
>>> + depends on EXTCON=n || EXTCON=y || (EXTCON=m && m)
>> Ugh. We need a better "pattern" for stuff like this, it's getting more
>> and more frequent.
>>
>> And no, I don't have a better idea :(
> I think this works:
>
> depends on EXTCON || !EXTCON
It seems to be better and works when I test the above patch.

Thanks,
zhong jiang
> thanks,
>


2019-12-12 14:59:40

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Thu, Dec 12, 2019 at 02:49:37PM +0200, Heikki Krogerus wrote:
> On Thu, Dec 12, 2019 at 01:20:53PM +0100, Greg KH wrote:
> > On Thu, Dec 12, 2019 at 01:18:05PM +0200, Heikki Krogerus wrote:
> > > On Thu, Dec 12, 2019 at 05:40:40PM +0800, zhong jiang wrote:
> > > > On 2019/12/12 17:28, Greg KH wrote:
> > > > > On Thu, Dec 12, 2019 at 05:15:28PM +0800, zhong jiang wrote:
> > > > >> On 2019/12/12 17:01, Heikki Krogerus wrote:
> > > > >>> On Thu, Dec 12, 2019 at 03:34:23PM +0800, zhong jiang wrote:
> > > > >>>> Fixes the following compile error:
> > > > >>>>
> > > > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> > > > >>>> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> > > > >>>> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> > > > >>>> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> > > > >>>> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> > > > >>>> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> > > > >>>> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> > > > >>>> make: *** [vmlinux] Error 1
> > > > >>> There are stubs for those functions so that really should not be
> > > > >>> happening. I can not reproduce that.
> > > > >> It can be reproduced in next branch. you can try it in the latest next branch.
> > > > > Can it be reproduced in 5.5-rc1?
> > > > >
> > > > commit 78adcacd4edbd6795e164bbda9a4b2b7e51666a7
> > > > Author: Stephen Rothwell <[email protected]>
> > > > Date: Thu Dec 12 15:48:07 2019 +1100
> > > >
> > > > Add linux-next specific files for 20191212
> > > >
> > > > I reproduce it based on this commit. The related config is attached.
> > >
> > > OK, now I get what's going on. EXTCON is build as a module, but
> > > FUSB302 is not. This should be explained in the commit message.
> > >
> > > That does not mean we have to force everybody to enable EXTCON in
> > > order to use this driver. Try something like this:
> > >
> > > diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> > > index 72481bbb2af3..06e026f6325c 100644
> > > --- a/drivers/usb/typec/tcpm/Kconfig
> > > +++ b/drivers/usb/typec/tcpm/Kconfig
> > > @@ -31,6 +31,7 @@ endif # TYPEC_TCPCI
> > >
> > > config TYPEC_FUSB302
> > > tristate "Fairchild FUSB302 Type-C chip driver"
> > > + depends on EXTCON=n || EXTCON=y || (EXTCON=m && m)
> >
> > Ugh. We need a better "pattern" for stuff like this, it's getting more
> > and more frequent.
> >
> > And no, I don't have a better idea :(
>
> I think this works:
>
> depends on EXTCON || !EXTCON

Yes, that is what I usually use for hwmon, though it dos look weird.
I agree, it would be nice to have something expressing such dependencies
in a better way.

Guenter

2019-12-13 12:22:51

by zhong jiang

[permalink] [raw]
Subject: [PATCH v2] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

Fixes the following compile error:

drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
make: *** [vmlinux] Error 1

It is because EXTCON is build as a module, but FUSB302 is not.

Suggested-by: Heikki Krogerus <[email protected]>
Signed-off-by: zhong jiang <[email protected]>
---
drivers/usb/typec/tcpm/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
index 72481bb..5b986d6 100644
--- a/drivers/usb/typec/tcpm/Kconfig
+++ b/drivers/usb/typec/tcpm/Kconfig
@@ -32,6 +32,7 @@ endif # TYPEC_TCPCI
config TYPEC_FUSB302
tristate "Fairchild FUSB302 Type-C chip driver"
depends on I2C
+ depends on EXTCON || !EXTCON
help
The Fairchild FUSB302 Type-C chip driver that works with
Type-C Port Controller Manager to provide USB PD and USB
--
1.7.12.4

2019-12-13 12:33:44

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH v2] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On Fri, Dec 13, 2019 at 08:16:18PM +0800, zhong jiang wrote:
> Fixes the following compile error:
>
> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> make: *** [vmlinux] Error 1
>
> It is because EXTCON is build as a module, but FUSB302 is not.
>
> Suggested-by: Heikki Krogerus <[email protected]>
> Signed-off-by: zhong jiang <[email protected]>

Acked-by: Heikki Krogerus <[email protected]>

> ---
> drivers/usb/typec/tcpm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 72481bb..5b986d6 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -32,6 +32,7 @@ endif # TYPEC_TCPCI
> config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> depends on I2C
> + depends on EXTCON || !EXTCON
> help
> The Fairchild FUSB302 Type-C chip driver that works with
> Type-C Port Controller Manager to provide USB PD and USB
> --
> 1.7.12.4

thanks,

--
heikki

2019-12-13 13:58:30

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'

On 12/13/19 4:16 AM, zhong jiang wrote:
> Fixes the following compile error:
>
> drivers/usb/typec/tcpm/fusb302.o: In function `tcpm_get_current_limit':
> fusb302.c:(.text+0x3ee): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x422): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x450): undefined reference to `extcon_get_state'
> fusb302.c:(.text+0x48c): undefined reference to `extcon_get_state'
> drivers/usb/typec/tcpm/fusb302.o: In function `fusb302_probe':
> fusb302.c:(.text+0x980): undefined reference to `extcon_get_extcon_dev'
> make: *** [vmlinux] Error 1
>
> It is because EXTCON is build as a module, but FUSB302 is not.
>
> Suggested-by: Heikki Krogerus <[email protected]>
> Signed-off-by: zhong jiang <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/usb/typec/tcpm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 72481bb..5b986d6 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -32,6 +32,7 @@ endif # TYPEC_TCPCI
> config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> depends on I2C
> + depends on EXTCON || !EXTCON
> help
> The Fairchild FUSB302 Type-C chip driver that works with
> Type-C Port Controller Manager to provide USB PD and USB
>