From patchwork Mon Jan 25 11:36:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 370580 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4617544jam; Mon, 25 Jan 2021 20:59:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlm319PJ5QZrMIjnx/QGqr0SMoRPtzrEtLeSQG22PrnbACVAyqp/+dTK2JpP/R2anpnrHD X-Received: by 2002:aa7:c94c:: with SMTP id h12mr3239691edt.40.1611637161636; Mon, 25 Jan 2021 20:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611637161; cv=none; d=google.com; s=arc-20160816; b=SkjRHogrdDBh4cuLFgANLettV27a180n1k5nS5Vw7UYUdP8MKBM1Hhk0WiiC10hQU8 6l9CJ+NhSAnk9LzKOK88mt25Z5dJ8OCmFZ8QyNuyPmqp6KiBLHgJvieonkHHEFSkZwak Yih9Iz8f6ILtqRPyOvOE3Ztavj0+uvBoiAn3Cpzy/qu2XZyBLqAzn1gJGaep3PqnJVa8 urpZJtaXV7yuEr0yztF6+uSm3ASQ8/FH2naWFojocQcIUo2vb9zufKDXxOo9yTil6flW RIUPqPGqBjz0WzPrmqy4Sw33BEFFOH+WqDWr4MgulTc7RYPj3ks0twI6/H3zT1Yk1UeW GVQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=W3a21lEktK5SOBs+PhlpBo+fUx6lGE/KyOXPSY0VBDA=; b=olVhIrJvRmd6Nrqnko5I6f4NSBAMYTc/Yptre+UEfF7Fw5N4PlD8Bv8Y/MAO+T81QT xgGqBNk5LWLMjY42DfApBBtfLPfjUWh4plSk+BRQ7OLU5xLmm4RglCN1GSS0qcu2/ymf THGeiyOpE1hll4mLpt/ekD4Ym4VFSnrRMg1SsFahWwy6rASgp9clvr3oVQ4susO1SjmF BmuIVAINyyOXdfmmzNAHWuD73NQDROg+tkocB8eMZlGnSgSNNVDA7cY484/RFJs1QwPs K9oWC8LnjaXr+khZPr0nF3flFofno1we5/4smzFC3ZWNz3Bt7YlpGym1OzZ369ksmgIb 9pMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MXSHl6tz; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl3si3059393ejb.356.2021.01.25.20.59.21; Mon, 25 Jan 2021 20:59:21 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MXSHl6tz; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729767AbhAZE5p (ORCPT + 7 others); Mon, 25 Jan 2021 23:57:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:33386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbhAYMKU (ORCPT ); Mon, 25 Jan 2021 07:10:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3AB722ADC; Mon, 25 Jan 2021 11:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611574619; bh=WZ4OUPFOvGvy2rifYYkrii+pkg7vZ94TulWEdEn/oG8=; h=From:To:Cc:Subject:Date:From; b=MXSHl6tzmf+NO9TJ6DSLHRZUPT+ML9yWvxVKPvwd1nb9ZzENuIWhGewqT0VtgiIx9 oNKUoScrs4sE5cxanWynV1qDGgLyv8tK79qUoFM2ulsF26+5R03R8wbIlSv4INVVEV F2834dCHBuH8kapy8YmAQbNCvTM4rIiyPHbvpCakcbcCOxdNrI4kMTJGR4gS0RioOi IRt3cg5Mkm9SfBibJst5YOeLVn1YWYw5C11blK+NSiq2898gJEVsF2JBcQ12TYdzoD EKXWHabpsxZyG/5/3SfEfFqkMGu/DjoWh7wYHDVSv8uVlDlz59FJi/CWug3WDLgKUk C+FVZQU2mCNIw== From: Arnd Bergmann To: ath9k-devel@qca.qualcomm.com, Kalle Valo , "David S. Miller" , Jakub Kicinski , Johannes Berg , Krzysztof Kozlowski Cc: Arnd Bergmann , Masahiro Yamada , Flavio Suligoi , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ath9k: fix build error with LEDS_CLASS=m Date: Mon, 25 Jan 2021 12:36:42 +0100 Message-Id: <20210125113654.2408057-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann When CONFIG_ATH9K is built-in but LED support is in a loadable module, both ath9k drivers fails to link: x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_deinit_leds': gpio.c:(.text+0x36): undefined reference to `led_classdev_unregister' x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_init_leds': gpio.c:(.text+0x179): undefined reference to `led_classdev_register_ext' The problem is that the 'imply' keyword does not enforce any dependency but is only a weak hint to Kconfig to enable another symbol from a defconfig file. Change imply to a 'depends on LEDS_CLASS' that prevents the incorrect configuration but still allows building the driver without LED support. The 'select MAC80211_LEDS' is now ensures that the LED support is actually used if it is present, and the added Kconfig dependency on MAC80211_LEDS ensures that it cannot be enabled manually when it has no effect. Fixes: 197f466e93f5 ("ath9k_htc: Do not select MAC80211_LEDS by default") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ath/ath9k/Kconfig | 8 ++------ net/mac80211/Kconfig | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.29.2 Acked-by: Johannes Berg diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index a84bb9b6573f..e150d82eddb6 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig @@ -21,11 +21,9 @@ config ATH9K_BTCOEX_SUPPORT config ATH9K tristate "Atheros 802.11n wireless cards support" depends on MAC80211 && HAS_DMA + select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211 select ATH9K_HW select ATH9K_COMMON - imply NEW_LEDS - imply LEDS_CLASS - imply MAC80211_LEDS help This module adds support for wireless adapters based on Atheros IEEE 802.11n AR5008, AR9001 and AR9002 family @@ -176,11 +174,9 @@ config ATH9K_PCI_NO_EEPROM config ATH9K_HTC tristate "Atheros HTC based wireless cards support" depends on USB && MAC80211 + select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211 select ATH9K_HW select ATH9K_COMMON - imply NEW_LEDS - imply LEDS_CLASS - imply MAC80211_LEDS help Support for Atheros HTC based cards. Chipsets supported: AR9271 diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index cd9a9bd242ba..51ec8256b7fa 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig @@ -69,7 +69,7 @@ config MAC80211_MESH config MAC80211_LEDS bool "Enable LED triggers" depends on MAC80211 - depends on LEDS_CLASS + depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 select LEDS_TRIGGERS help This option enables a few LED triggers for different