linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	zhong jiang <zhongjiang@huawei.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state'
Date: Thu, 12 Dec 2019 06:57:22 -0800	[thread overview]
Message-ID: <20191212145722.GA361@roeck-us.net> (raw)
In-Reply-To: <20191212124937.GE31345@kuha.fi.intel.com>

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 <sfr@canb.auug.org.au>
> > > > 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

  parent reply	other threads:[~2019-12-12 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12  7:34 [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state' zhong jiang
2019-12-12  9:01 ` Heikki Krogerus
2019-12-12  9:15   ` zhong jiang
2019-12-12  9:28     ` Greg KH
2019-12-12  9:35       ` zhong jiang
2019-12-12  9:40       ` zhong jiang
2019-12-12 11:18         ` Heikki Krogerus
2019-12-12 12:20           ` Greg KH
2019-12-12 12:49             ` Heikki Krogerus
2019-12-12 14:20               ` zhong jiang
2019-12-12 14:57               ` Guenter Roeck [this message]
2019-12-13 12:16             ` [PATCH v2] " zhong jiang
2019-12-13 12:31               ` Heikki Krogerus
2019-12-13 13:57               ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191212145722.GA361@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).