Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp228993rdd; Tue, 9 Jan 2024 02:10:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IECnfgN7zc+tqH7bxCmjbO7hSOULkUTobpaW59/htrabk7uxvKuxMfbUZXgNvCKr5JphXPG X-Received: by 2002:a54:4110:0:b0:3ba:10b1:7a24 with SMTP id l16-20020a544110000000b003ba10b17a24mr5456312oic.105.1704795058757; Tue, 09 Jan 2024 02:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704795058; cv=none; d=google.com; s=arc-20160816; b=McUIU3jnbB/0UHqzc1OsICQGwdPbcP/Ck1izS7YqY4lY0d9OqOdr4nXoB8dy4RpLzP z8x/n1TrliRS5cLRUbRJPzufXrzMTeefae8xPu7XiSwL2pzsXoX4hb8e83T2r4VgAQpB 8OIHOISBDF2ov836carY/YbApJKhfv9CwcR/tX1wZbpVhOHOyboMX8Bd5VSNKLKj2QHp FiU7eYwFyyNmqmGVGN+K7t+lubGr8f3Lbw4kJ0/0OtKBYEvBshaPuBPqttWypELlQFhf 5S/9OmsuPLqTaT0vv6a8dz1/CX07vuBF5K7cE4F0qyS1o5IZt+9MOS8xG6m4xpDp3ygx 6qEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=li8wtv11pYdgoNeEu9fSAYSfT2EiVS4SAirIke9Z5lU=; fh=I7aZnWSbcP/leh7wZ6ovuVInJ5CuCTHQqTUS5Kepd08=; b=XM7mmD8zE7q4b95Zc2rsgEt3q8GNGWUPOXwIPTGOrPKSzBvyQr/Jad9OF2d8Uloyks IHCBhxzKzxjZKCgucj7zjaglfNTmMu2yucIcGxPUWpxlBK+1ZUF3HCj7m+hrkfaL8fqE BD44QXaiTkHWCp4cHpSJy/MKT55yPt8skoyJ5j5xzRfDgDmI7DdHwSU/q8yURnJLYusA jY3hqoJzx1j8Ve09wewtI/WEiCXVMY+oO7TXfESB9ANZ2ZO6Pyx9D2sa7Zhrodojw+DT +bEiFHZlVdIeocJx35FzyTxxnh+T50PAItmySbaGdqqXhQyMS6ev8Q8BHgwR1mgnfHpl QWOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="gOWF/7Pk"; spf=pass (google.com: domain of linux-kernel+bounces-20701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o1-20020ac85a41000000b004280bd3f0a3si1769081qta.542.2024.01.09.02.10.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 02:10:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="gOWF/7Pk"; spf=pass (google.com: domain of linux-kernel+bounces-20701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6F7141C2468A for ; Tue, 9 Jan 2024 10:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB2E360AC; Tue, 9 Jan 2024 10:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gOWF/7Pk" Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4C9335F18; Tue, 9 Jan 2024 10:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5542a7f1f3cso3110923a12.2; Tue, 09 Jan 2024 02:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704795009; x=1705399809; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=li8wtv11pYdgoNeEu9fSAYSfT2EiVS4SAirIke9Z5lU=; b=gOWF/7PkVTBVphxY7c1eD26+88adUqAdnONwxkAL3LyQU3CRjqgtTMO2n1rzd4jMsF uIEtDdpWCZ7iPeK2fXx1+8icRCgmx7k/ZgRGIT25ebqXi6Is91IDeEsgjzJ0PncsKHqy yAn387i3y6KPfcGjG3pbl1PXh+a678idMYiKwYmrvHAXEH8fVqn48x7VzOO9njHUSsAD UYW1QqHRTZHpRALeL//eufxNyuVGdTdXDNZIboBL/DUMgyunwODKwWLIwU2oPVEt37Up Sdnve4tgcuJVYbLUBi5Z1HHyRyiyHcf/b8y0zTe6QTPTDC/OuQFXiAHakShyZFXQ4Tbu jXKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704795009; x=1705399809; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=li8wtv11pYdgoNeEu9fSAYSfT2EiVS4SAirIke9Z5lU=; b=m5d1mZB6OL/Yf6s0Fj4lsyKWiwPJZKIca0oxTVkae7+m8NmIszXA0cLbmZVYuy8mix 1KJFvUZaTNOPZZExkh17pP0b5Ps5hM2jxXclkxV3jiswd/7moi+A0tq76ySVOUxpOtsz fJCoAE2d7s7ddVM+cgcjxj4E5d7xZWCXUv/ddHqg+cF+vQmUF0eKQA/SGoJe8inCdoqv lTm1cEProrqz60HKm13J7dfKX2wYVv55gJqussQw5mvCppgjQ0R4UcUFfD5uNLbUB70r iazjeo3C3SmSNd+FtY+LH9ECN2Nr/FAPoleW0NPRnxcGE+PzSXqIi9eWsLsg+V1YZ7/V TA2g== X-Gm-Message-State: AOJu0YynvlNUnVyuDeBg6FTqp4pq5iBp85i5Mc2sMFly/MPAcwffExxP UfQDzA+O7n0YpiMYBYGQ5FE= X-Received: by 2002:a05:6402:b27:b0:557:bcf0:b5db with SMTP id bo7-20020a0564020b2700b00557bcf0b5dbmr1310333edb.67.1704795008736; Tue, 09 Jan 2024 02:10:08 -0800 (PST) Received: from ?IPV6:2a01:c22:6ec5:5b00:b85e:554d:d507:dda6? (dynamic-2a01-0c22-6ec5-5b00-b85e-554d-d507-dda6.c22.pool.telefonica.de. [2a01:c22:6ec5:5b00:b85e:554d:d507:dda6]) by smtp.googlemail.com with ESMTPSA id cb25-20020a0564020b7900b00552d03a17acsm779582edb.61.2024.01.09.02.10.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 02:10:08 -0800 (PST) Message-ID: <4c859da1-9551-4d0b-a19c-f20f1133acac@gmail.com> Date: Tue, 9 Jan 2024 11:10:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] leds: remove led_init_default_state_get() and devm_led_classdev_register_ext() stubs To: Arnd Bergmann , Pavel Machek , Lee Jones Cc: Andrew Lunn , Arnd Bergmann , Hans de Goede , Jean-Jacques Hiblot , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240109090715.982332-1-arnd@kernel.org> Content-Language: en-US From: Heiner Kallweit Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4j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ECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <20240109090715.982332-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09.01.2024 10:06, Arnd Bergmann wrote: > 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 > --- For r8169 we have a Kconfig-based solution now, right. I had a brief look at other drivers using LED functionality, and already the first one I looked at seems to suffer from the same problem. input/keyboard/qt2160.c has the following what should result in the same link error if qt2160 is built-in and CONFIG_LEDS_CLASS=m. qt2160 has a Kconfig dependency only on I2C. #ifdef CONFIG_LEDS_CLASS static int qt2160_register_leds(struct qt2160_data *qt2160) { [...] error = devm_led_classdev_register(&client->dev, &led->cdev); [...] } #else Personally I don't have a strong opinion pro/con IS_REACHABLE. I see two options for now: 1. If outcome should be that stubs are a good thing, then the condition for the stub should make sure that the stub is chosen when needed. This would result in using IS_REACHABLE. 2. If stubs are removed (but also in the current situation, see example), then it seems some drivers need adding proper build dependencies.