Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp877714ybl; Thu, 12 Dec 2019 06:21:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyNDqT6lL82HHBHK/lL7H6SOiNF4IJ/t2FdqGTIdpaEfalCldyrPIFPEpbTL2x77tVrXOA+ X-Received: by 2002:a9d:4f0f:: with SMTP id d15mr8589419otl.179.1576160483831; Thu, 12 Dec 2019 06:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576160483; cv=none; d=google.com; s=arc-20160816; b=seHU+t0h39lZjsZ5eiUHfQLAroiYgkL8I1B/C4oY2rLdu/hEqYbRw4ZsVWv4BVtsTc HsNq38xZjCwoi1nyG/Ny/tDO1A7NktfXTybO1Y4nTuNOqIxISy2/DcLpJ/k9gwKc6JQe u8WSlgV569l7dEVeN9NBp8UTcAF6/QuXe/hXz18x2Dv3Kz8mlEo2t+zNTtIgoYWqxw+G aOnbjZda1UZLSEgnfuhsb5lUP1q6W0LdQ7RiV5EIEzbEEh3yWLWxvrLBYmeWZ00Z9Lsw 19TCHB9B+ojsl4tH1d/2Upw6/KuebMvHhhgQMCMCjzpmbyZX+8U7plhDOnFgu1Pvuh7c 9Adw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=QsZg03hm1yAZ5yWP9y/eh4fr+/dmcQX/ybH3uKfticY=; b=Chd6aWV5EeYsm0n3FU61XeF9iS7/DBAjBQRG4bX2lOfiGajOF3hjFL3KbiCMVxnw0s 1x0W78/YCJ6SPOSgHfys00HCRQQhhRxsNhA0ay55uZBZpe7Mzsxzn6eLjwFhFYaMZO3x BFdx5btuH7KEeMcqCPb+KLuhWpmqffz4+dEZB239lCjZUHPbV8XM1l8XRfcFPcW4bwKt 7OEBldzqMpOXYC3yjXP0yecHvn1LgF/rCWSR6SHgo23/8diX38EVeFkKP8QMa9dzIfTf hLvP0MZ2i8RaYpRHl1IcuHpjTRvK0GtPUVML5jx2E6JgSsZPl73/beRGIoySdQc7/IMc 5hmA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v92si3495779otb.140.2019.12.12.06.21.10; Thu, 12 Dec 2019 06:21:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729691AbfLLOUR (ORCPT + 99 others); Thu, 12 Dec 2019 09:20:17 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7227 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729392AbfLLOUR (ORCPT ); Thu, 12 Dec 2019 09:20:17 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id ECD4EA4312FAC6B1B3DC; Thu, 12 Dec 2019 22:20:12 +0800 (CST) Received: from [127.0.0.1] (10.133.219.218) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Thu, 12 Dec 2019 22:20:11 +0800 Message-ID: <5DF24C9B.7030402@huawei.com> Date: Thu, 12 Dec 2019 22:20:11 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Heikki Krogerus CC: Greg KH , , , Subject: Re: [PATCH] usb: typec: fusb302: Fix an undefined reference to 'extcon_get_state' 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> <20191212124937.GE31345@kuha.fi.intel.com> In-Reply-To: <20191212124937.GE31345@kuha.fi.intel.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.219.218] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>>> 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, >