Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp776507ybl; Thu, 12 Dec 2019 04:50:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyh2W17WlBY8lfkwoj8yoPHxQRG0J8jfKZ+ZOre7QkV1O75Ul5rNkRhLtcGMhPT4RT3GY1D X-Received: by 2002:a05:6830:1707:: with SMTP id 7mr8261739otk.185.1576155027070; Thu, 12 Dec 2019 04:50:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155027; cv=none; d=google.com; s=arc-20160816; b=iJOIUj9nOC03QYY6U9/DBcV9ekG/eaIp21sDjM5istJG8LFDFFKCeqk7WDbWxN68j8 Iw5mhxll7pQgTFaHWd5faaa4aQNbp4gES7uVViV7Sx56tD5urCbSG4i9T34q5lOxdsIm 71+VbWIDxmN8Wpv2BPChuMTdib5e+pWycD6w36hfQaUTb0vV5jMNx7yZ5CLsT+20Qdvc ev2d/s3JNsm9Kh875gk43Tp6yEmWVk/S9b1mMHneN1j53ikXypEy+q5mr2oQH0aWnMyw AKl/2NDnQI/5ghajCIYNg1+BWCNBf3Z+lsubf/QGlCZyoBIvHL8hZ70h/IIyrglS48aN kGow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Pu8XL+jxvfG2dSf2q/if78SerWS5y6+u4gK0TmfH3J0=; b=FSalPv+cpqnPKBh4CMxk9sc230GxeA+GN0GtZL1LBWIjNTfPEtV202O5uoesHLiNth 0xMTO0YNGlY9yBHDt+82AgBLxySLiXUILEGlmVLUAR/aPF3Vr5zlrSGQMoRAIPDrsq9a yOQFVQBH8nuQGMjArf37YSh8TEgz/iilyUemgUVs42D07Ngklf+Jv5eOQwnN9G0qadGd ab9gh3Nlp6Z2tdwJB1ES22ByB35EJvXCp+ZK1nluIQCl9zZSlsoLp2y5Edl3+rscWsF0 2nCF9ywpghe7h4vOUCa4pgeH6JNV2p62t4JkcMH4e/S5yyBJ/+XKbfALQIXR3wyUVjxX WxDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si2899295otp.273.2019.12.12.04.50.12; Thu, 12 Dec 2019 04:50:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729252AbfLLMtm (ORCPT + 99 others); Thu, 12 Dec 2019 07:49:42 -0500 Received: from mga06.intel.com ([134.134.136.31]:32452 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729207AbfLLMtm (ORCPT ); Thu, 12 Dec 2019 07:49:42 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 04:49:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,306,1571727600"; d="scan'208";a="220686438" Received: from kuha.fi.intel.com ([10.237.72.53]) by fmsmga001.fm.intel.com with SMTP; 12 Dec 2019 04:49:38 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 12 Dec 2019 14:49:37 +0200 Date: Thu, 12 Dec 2019 14:49:37 +0200 From: Heikki Krogerus To: Greg KH Cc: zhong jiang , linux@roeck-us.net, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state' Message-ID: <20191212124937.GE31345@kuha.fi.intel.com> References: <1576136063-50916-1-git-send-email-zhongjiang@huawei.com> <20191212090132.GC31345@kuha.fi.intel.com> <5DF20530.2040509@huawei.com> <20191212092805.GA1375559@kroah.com> <5DF20B18.4020601@huawei.com> <20191212111805.GD31345@kuha.fi.intel.com> <20191212122053.GA1541203@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212122053.GA1541203@kroah.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > 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