Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp204146rdd; Tue, 9 Jan 2024 01:07:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnbeKRnK4IQk6j1YXx6ApNK2R9o/N+C+uDUZ9I4rcB7FVbfBuPdRNhfkUKS6fKoPGoCdVu X-Received: by 2002:a50:8e4e:0:b0:554:36d8:564e with SMTP id 14-20020a508e4e000000b0055436d8564emr2576845edx.7.1704791251756; Tue, 09 Jan 2024 01:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704791251; cv=none; d=google.com; s=arc-20160816; b=po08RhXtljD1VXKWR0ot7LA1uPtZFFi+wi943HQ1bOrNYKPAVPq4o9VcjM+jmx/ovo yJYg6GXVlB+vSItR5bET7z0sW3uf2YAbCNdMESVuiA8ZHvHaTofuz937jpGU5/ixLLAV nSnEv76rWP3I183R7j52cfbGyrh6BDQaGuyK9cdnpnC5cFN6cvell6XQlrlSK+Gznsff e+Y0tHYZkT2cuwdk86s9IC/T3YgHFslkRPL604J0qe897iIzQdwKP5NxD9hUZX36mAsP Z6Phn2XxWNk2S8JL3emnkO8UgtrmTZz+TWpr8+4llM0nzlKBFCage4T5hNDEoiKF6x+f MjIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=KIwDD+EgdrTJjF08wUWteceaQ72HzeBilkjE77xADVk=; fh=cM3CdW0MdjmKQsq6MO6b3lfJE9/tT6zu0GXpzzKC0is=; b=ZCUrteHdW2W7dNI/htGCkNW6MDKcqVFVirFEmX5virREcj0yviRwXscluyEWDL29fD OhoEzn2qp8mUIh+sG/WN+cv1/x5+0+JQU8Gf3WPNIW9lMUb8SQE02pCCH268yXdbU0ck YXHttARtiW2CFQ49Q1qTJ64k2YPKfvaOTR4hdLI+VESYalA2efcf8S7UKGt+5nWY9RKU IC0YgTjeuqw2keqoNmhhigC1V0QR0LF12dvkmQEqZCqxFG5Go2vSWrGgYjRGQWSEriW+ hfx0Uzxv5E30bBnnW9VKkkqS/zd7RrZl1O+yD5EC8sI5l5GYj86SzBOHj24sRH7tzqXp 467w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dXDIjDdd; spf=pass (google.com: domain of linux-kernel+bounces-20629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl9-20020a056402210900b0055820acd5b6si84180edb.568.2024.01.09.01.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 01:07:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dXDIjDdd; spf=pass (google.com: domain of linux-kernel+bounces-20629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7E0F01F236EE for ; Tue, 9 Jan 2024 09:07:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F351B29CE9; Tue, 9 Jan 2024 09:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dXDIjDdd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30C9629410; Tue, 9 Jan 2024 09:07:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF651C433F1; Tue, 9 Jan 2024 09:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704791241; bh=dSOcicXkDevstKESzuK8GI+KUchpjc7Y4JI1vu4BtEU=; h=From:To:Cc:Subject:Date:From; b=dXDIjDddKtKhlVJ1zo6hgzHmmHevF42ed2L6EuK9GEQpiV3/PvamCbvGMvNbN2LnF feRMKlu20+MmGjZVhqqJ+sZRfSIryZxvFT+KM7cH5wUkBuHcN/1L3pMDlBnB1qn2Vf 68sor1/Pex+OjDtDCTdEk+h4MwikRscwXywxAl1MeON+WWtJ5hA8AConCrti22ocNU 7h3Tt8a/6GtX1q5QefqNWayy2yqH2FFu/FMcxQ8tHfhyaYK4buF/vDIh+adtXdLn+j +Lp9ZkA29qVtz+Qsw+iFr+FzXByfS5PKBPc/5u5hVwEG6W3+xARtCM1/7iQDhFtxYa p5aQ8hjU4Ii6g== From: Arnd Bergmann To: Pavel Machek , Lee Jones Cc: Andrew Lunn , Arnd Bergmann , Heiner Kallweit , Hans de Goede , Jean-Jacques Hiblot , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] leds: remove led_init_default_state_get() and devm_led_classdev_register_ext() stubs Date: Tue, 9 Jan 2024 10:06:39 +0100 Message-Id: <20240109090715.982332-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann These two functions have stub implementations that are called when NEW_LEDS and/or LEDS_CLASS are disabled, theorerically allowing drivers to optionally use the LED subsystem. However, this has never really worked because a built-in driver is unable to link against these functions if the LED class is in a loadable module. Heiner ran into this problem with a driver that newly gained a LEDS_CLASS dependency and suggested using an IS_REACHABLE() check. This is the reverse approach, removing the stub entirely to acknowledge that it is pointless in its current form, and that not having it avoids misleading developers into thinking that they can rely on it. This survived around 1000 randconfig builds to validate that any callers of the interface already have the correct Kconfig dependency already, with the exception of the one that Heiner just added. Cc: Heiner Kallweit Link: https://lore.kernel.org/linux-leds/0f6f432b-c650-4bb8-a1b5-fe3372804d52@gmail.com/T/#u Signed-off-by: Arnd Bergmann --- include/linux/leds.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/include/linux/leds.h b/include/linux/leds.h index 4754b02d3a2c..7598d472903a 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -82,15 +82,7 @@ struct led_init_data { bool devname_mandatory; }; -#if IS_ENABLED(CONFIG_NEW_LEDS) enum led_default_state led_init_default_state_get(struct fwnode_handle *fwnode); -#else -static inline enum led_default_state -led_init_default_state_get(struct fwnode_handle *fwnode) -{ - return LEDS_DEFSTATE_OFF; -} -#endif struct led_hw_trigger_type { int dummy; @@ -279,20 +271,9 @@ static inline int led_classdev_register(struct device *parent, return led_classdev_register_ext(parent, led_cdev, NULL); } -#if IS_ENABLED(CONFIG_LEDS_CLASS) int devm_led_classdev_register_ext(struct device *parent, struct led_classdev *led_cdev, struct led_init_data *init_data); -#else -static inline int -devm_led_classdev_register_ext(struct device *parent, - struct led_classdev *led_cdev, - struct led_init_data *init_data) -{ - return 0; -} -#endif - static inline int devm_led_classdev_register(struct device *parent, struct led_classdev *led_cdev) { -- 2.39.2