From patchwork Mon Dec 16 13:18:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181718 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4290985och; Mon, 16 Dec 2019 05:19:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxoXQeXpLcLURPRpQ4Fv9lzg01Ptbh6lfH5dyrIolYSdAiIjxxABzGqAmTy/RKs8rlvjj0h X-Received: by 2002:a9d:dc1:: with SMTP id 59mr32495950ots.250.1576502376986; Mon, 16 Dec 2019 05:19:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576502376; cv=none; d=google.com; s=arc-20160816; b=MsMX1QXajDTE4jtrbEWNS2nKteZQfSmQiAbk8UAxF4DAYwURe2Xnxn//A9XMKMfwG/ SewMKLs15Ly0BvVmjIn6mo0Uxcpa+rWcnYbpJyv4PWcPZ3KiUVFL46nK+xg2i09M8nTe Qilcnxelavsr7rOgAzsz//uaf2ehAyMvFDu1zyFlyn6EJzrI+n3fvcIH2wQXHoSX9Ckw vvocPvB8EAw5jkNi3cO038VvWbWce51pH3/La8l83eT5eYxiIg8Wbp87CHYdyG7zMwXr EAB8txOq0mUSiqferCOYbDfAsyHgilqsfFZu3Ayjj7S3lttJTESYeLBJBUVYiSXr+cZG I3bQ== 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=QfrfG1KDLkv56PBSYYu1JwmM7bbTAnmV1GmRQTWrpAg=; b=qBfrHRiLrP7sZsLuqmjCeCmI/kd/lE9gKmpxpcVecifG/YJ/Ves+R463pM3+HA8xFx U2D39Pl3ZAl3oUu1inhhPAQ4ZnvINWMXc2nLCRhfmdMKXtF3HWHcVnn2r7UZrdLh4x/N /opVmZMjckrvJxWYKMhGBeOgf5J/uh08m5n8yJccfaS8S6eN9oXDnvvbZbDvJDLl5Wk2 FrgDmBk0auMhvWgcQ04sXTn3rbMXOL2pywYkYyofXDZTfKnIssfoljSHy3EJT09cW7eZ kmwovl4jAm5pUWn+Zr8dKVevk5+uUNuyJF6Rh4hX2ZWopcu38UYRukOwAJ/xGncmKw6d pTPA== 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 101si11651228otc.322.2019.12.16.05.19.36; Mon, 16 Dec 2019 05:19:36 -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 S1727869AbfLPNTf (ORCPT + 27 others); Mon, 16 Dec 2019 08:19:35 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:36633 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbfLPNTf (ORCPT ); Mon, 16 Dec 2019 08:19:35 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1Myb8N-1hmQPH0w85-00yyN5; Mon, 16 Dec 2019 14:19:06 +0100 From: Arnd Bergmann To: Felix Fietkau , Lorenzo Bianconi , Kalle Valo , "David S. Miller" , Matthias Brugger Cc: Arnd Bergmann , Ryder Lee , Roy Luo , Stanislaw Gruszka , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mt76: fix LED link time failure Date: Mon, 16 Dec 2019 14:18:42 +0100 Message-Id: <20191216131902.3251040-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:FfIXsVXcNeBt8DM3/oD14gV9AaEg1kuMd8THyqz4/RSYXt8bzol VT4nBhvNIR65oxPVAJBoQCx0Mg5xsmZZG4yY3iGDfIiztAFr9RRwyuwPZKCC1hP2Ebc2X1g FX+vENnYZfUQsOedDzvoVbIxv6rRVM10x3+jQQ75bdj2i/k+bC7y4tgiHPKrg398sgXI1Hk CLe6qn9H88bpgLmlWv4pw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:iAZnidCZDMU=:WDeq3eS82GM9y63nrZiRmo 3JUG+UEbatz6cBmivM2B7+tBfsLXMZPjHyLnrYgr8AQyO4VWAWkAXvdINXftuV1yV9kOT2rJu rFD+Nb3NkNJP8T0W6aM3QVe+3hkwqidu4Qhbd7gcSGqEBJEJ1wEmoI5q3AWpjo4SVRh8BY/n8 1+v+yWdQEGSsYoAMpz0Q1pIWrsWpqQH59RXvBqCkFqpBg55DuFUvLAKZEnScfkj0zIDN9Sgh9 y8edPkXPZocBM/alaots63k5Bc2TPiRiRqRs+U63biMkj68b47s3D6euxclI+ZalStQg9kw+t ltbSCk2Y5gaZ0nKKOX9lNNTof0DsU+auYJNy6RLT9k0pOwQ4VA2fXM1jzReLUS0jM/krpArf8 uWGrdBr2/oEAAhhmoD7+dtqG+po7AwkTWOJYCDELxbGHPkKCDKPL7nOScNrIVqIO9hJA3XFwx OwY458CCIgKVJrBZKeI4EqLCmBs0J33fFkJcFCHjT1OWO8EBfmbv4nij7kY56kIynKxQRLJi6 EbqKgPjtXCx92W+gDjbgHclBHuonNeSJXn1wm1FG2xglOPqs3qH5324sYq6NlZeehhTGpudYM gyV9UmJ+mEXBCI2NyjMtMLnyfRn72odkyFt6/CC82Lz4MCI3EKl8sWGx1y8G9G41Vj2GPmPUN pNjMciMVw6LVfiIKdJFboThBK+H2qcvbEszQ69sDfbLW3KUmmjMRmksX3R5XlgWcO/1lWCQnk h7NruKmPzsF471JVvfDsgChsoHsHBMUZQN3WT7y3wNhZtPFNmNa7aQovOOtyklkh7XhJHfyaJ nFkOl56Fng8tuNQkCDI+XFmo/EQGsS8UfUm8JRGCi1clYe0Kv1fT8B8zoCvK+9Wy7uvds+1QB fTcUteDG3KZFdJlzhPOw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mt76_led_cleanup() function is called unconditionally, which leads to a link error when CONFIG_LEDS is a loadable module or disabled but mt76 is built-in: drivers/net/wireless/mediatek/mt76/mac80211.o: In function `mt76_unregister_device': mac80211.c:(.text+0x2ac): undefined reference to `led_classdev_unregister' Use the same trick that is guarding the registration, using an IS_ENABLED() check for the CONFIG_MT76_LEDS symbol that indicates whether LEDs can be used or not. Fixes: 36f7e2b2bb1d ("mt76: do not use devm API for led classdev") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/mediatek/mt76/mac80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.0 Acked-by: Felix Fietkau diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index b9f2a401041a..96018fd65779 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -378,7 +378,8 @@ void mt76_unregister_device(struct mt76_dev *dev) { struct ieee80211_hw *hw = dev->hw; - mt76_led_cleanup(dev); + if (IS_ENABLED(CONFIG_MT76_LEDS)) + mt76_led_cleanup(dev); mt76_tx_status_check(dev, NULL, true); ieee80211_unregister_hw(hw); }