Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp616009ybz; Wed, 29 Apr 2020 06:26:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLxiK0/gD6xWNMfJqCCFn5agVQR/JBg1BOk16j6hKYmvBkMlSrlcLlhDaa96KEd2x5HztJy X-Received: by 2002:a05:6402:1684:: with SMTP id a4mr2317510edv.99.1588166808981; Wed, 29 Apr 2020 06:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588166808; cv=none; d=google.com; s=arc-20160816; b=rVsxA3b/GhvZ0T+osXjL5GmS2nboOjNEw//BL0JZQRotoEwmZ5/3en1jxgDJlafowW 2QduDzuNk5f3SuRh8zUcGQiX07YYXbkDOTgQuoXV4fffDRwhDE0/n36kguqcW8lLGOJr V7AYr4wqoqD5HV4txkVCMmKQDxYJ4zTFuL3JJ0h1/U/kjMW+fg2CkVokDzkjJgUzGwDK vAaeh4aU9H93rcD7LOpqSJfCIFUDp8xU3BD/RxupttzupaJnTJffXW+7DkVLpY+If/1z m3uuvQ5/R6SiwROK0F0GZPRLb+BicLuF2luuigq/IPm9BkgL8RXsVf4OhxpO4ZpNYxpH OWzg== 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:mime-version :message-id:date:subject:cc:to:from; bh=7WQt0SLRCtJapHCmbpxboGpW8K3HDn3ytvAm3gaiH6k=; b=eZR80LuOpoJjS54JHKgn2VGUK4ZDowNXo+fOpanhchy10KcRLKCYu0K9s17gTTRmdp 4ikMX9IdhAdtLMZkY9bEhYIyPv7DQiMw2aJer0hiaYPm5yzhwkx4iJLi3ir4SyfCJL9G GZrrPseC9eDubrnRuB16N7N6y1PArELmx5KJu3BKOBAsTKl6OX0JCfKIkFrzagftUavm YC6+TdtOE5FCXbDCUeHXYG0pyNG3C4lism/b1+Ra4CirCdoezyvQRZJ5sNJD0eDUPCp6 vuPh8I/am1WbETKbJPTHT6kOitlbYGJzUwmsjTu5bdQIorDfEJuLzqfUZJ5gTT8NiE/J 0azQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch10si495726edb.454.2020.04.29.06.26.25; Wed, 29 Apr 2020 06:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbgD2NZA (ORCPT + 99 others); Wed, 29 Apr 2020 09:25:00 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:58085 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgD2NY7 (ORCPT ); Wed, 29 Apr 2020 09:24:59 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MN5W9-1jmHai06Xl-00J200; Wed, 29 Apr 2020 15:24:45 +0200 From: Arnd Bergmann To: Sean Wang , Linus Walleij , Matthias Brugger , Light Hsieh Cc: Arnd Bergmann , Sean Wang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] pinctrl: mediatek: fix mtk_eint link error Date: Wed, 29 Apr 2020 15:24:22 +0200 Message-Id: <20200429132443.1295194-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:b2K8SGt0tNbKweRcNNd5na2gw56bnc7G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 0xarjRVA9hEnrsUt/yUbISYhgeHa+OrMmkGh8ORCnQZWR5f9Wg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a configuration with CONFIG_PINCTRL_MTK_MOORE=y and CONFIG_PINCTRL_MTK_PARIS=m, we end up with the mtk_eint driver as a loadable module that cannot be linked from built-in code: aarch64-linux-ld: drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.o: in function `mtk_build_eint': (.text+0x304): undefined reference to `mtk_eint_do_init' aarch64-linux-ld: drivers/pinctrl/mediatek/pinctrl-moore.o: in function `mtk_gpio_set_config': pinctrl-moore.c:(.text+0xf80): undefined reference to `mtk_eint_set_debounce' aarch64-linux-ld: drivers/pinctrl/mediatek/pinctrl-moore.o: in function `mtk_gpio_to_irq': pinctrl-moore.c:(.text+0x1028): undefined reference to `mtk_eint_find_irq' Simplify the Kconfig logic to always select EINT_MTK when it is needed, and remove the 'default' statements. Fixes: 8174a8512e3e ("pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module") Signed-off-by: Arnd Bergmann --- drivers/pinctrl/mediatek/Kconfig | 4 +--- drivers/pinctrl/mediatek/mtk-eint.h | 28 ---------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig index f32d3644c509..b6a8d91f4885 100644 --- a/drivers/pinctrl/mediatek/Kconfig +++ b/drivers/pinctrl/mediatek/Kconfig @@ -7,8 +7,6 @@ config EINT_MTK depends on PINCTRL_MTK || PINCTRL_MTK_MOORE || PINCTRL_MTK_PARIS || COMPILE_TEST select GPIOLIB select IRQ_DOMAIN - default y if PINCTRL_MTK || PINCTRL_MTK_MOORE - default PINCTRL_MTK_PARIS config PINCTRL_MTK bool @@ -20,6 +18,7 @@ config PINCTRL_MTK select OF_GPIO config PINCTRL_MTK_V2 + select EINT_MTK tristate config PINCTRL_MTK_MOORE @@ -38,7 +37,6 @@ config PINCTRL_MTK_PARIS select PINMUX select GENERIC_PINCONF select GPIOLIB - select EINT_MTK select OF_GPIO select PINCTRL_MTK_V2 diff --git a/drivers/pinctrl/mediatek/mtk-eint.h b/drivers/pinctrl/mediatek/mtk-eint.h index 48468d0fae68..f40dab50a5f3 100644 --- a/drivers/pinctrl/mediatek/mtk-eint.h +++ b/drivers/pinctrl/mediatek/mtk-eint.h @@ -68,7 +68,6 @@ struct mtk_eint { const struct mtk_eint_xt *gpio_xlate; }; -#if IS_ENABLED(CONFIG_EINT_MTK) int mtk_eint_do_init(struct mtk_eint *eint); int mtk_eint_do_suspend(struct mtk_eint *eint); int mtk_eint_do_resume(struct mtk_eint *eint); @@ -76,31 +75,4 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_n, unsigned int debounce); int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n); -#else -static inline int mtk_eint_do_init(struct mtk_eint *eint) -{ - return -EOPNOTSUPP; -} - -static inline int mtk_eint_do_suspend(struct mtk_eint *eint) -{ - return -EOPNOTSUPP; -} - -static inline int mtk_eint_do_resume(struct mtk_eint *eint) -{ - return -EOPNOTSUPP; -} - -static inline int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_n, - unsigned int debounce) -{ - return -EOPNOTSUPP; -} - -static inline int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n) -{ - return -EOPNOTSUPP; -} -#endif #endif /* __MTK_EINT_H */ -- 2.26.0