Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp802059rwe; Wed, 24 Aug 2022 09:10:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Bn06IAJe76X3491gheU3WoGUMtX7XzKmFWnzBHmCir2pMVPbhfyJA7cTjI1r8hMnC2+zz X-Received: by 2002:a17:90b:4c8e:b0:1f7:2083:a91b with SMTP id my14-20020a17090b4c8e00b001f72083a91bmr9132090pjb.119.1661357423239; Wed, 24 Aug 2022 09:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661357423; cv=none; d=google.com; s=arc-20160816; b=aXyR1zoVkA0XCA+iSU1xvml/PkeHh7tTb+4Y+f06wjb9X46jqKea+SqsNum6Yzkeru iH7ueglldsv9pTFQfO2RaNTioBrgyqHSiPM9o0aDv7UDVo28Xx3ZE/ZxieJOJ42E5Dxw hKlriVbyr8MmkjveJyDQJhWN2LTN1a0jRA5mAJU6fKcPDISS2ybMPrcfakgzSFVGEdLJ K3yhyccLCB3uyF1k9eWO3KhRRXMPa0JKLRFZa6xnG/VOFIx/9rgbj3T4BmMPrVZZYp00 5YW6PGSgRsgyMJIMcSA4lO606WRnJVWP2Qzt0DhlJ/WEVknFzeD5RlvAvrsb7zq+8ygo vY/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JayAHS+OuNb+tyTryqcDsCuLA5dC38MXJtz38feqpuE=; b=RIIWdFOP59a71vlRp9ybAXKbI7ciIElG86n8ONf3HVKtaMw4vjqr3z9k4x8A0THF2s njVEMA2EowWLftViyNtH+1cARMLE3tN1+9OPNX04WGHS5e4t5/3Burk7xdPuSf13csPk 8l+cG+0vvPDtQ+98qecqptIwSaZAx87+bdF/ygBiS9u83OwUfYxLBOvJ/NUcvsmTxdNB nTej6Mia824jw3Bh+fkbqCiT05o0gThSE0R8SdvrVyZ9uTe3rokhVqdFEY3ZKyrIAQ1q aJX8GMbBalA0RaJwUoZcfvc9LMICZh4iQjmpOtf6G9RX3vgpPCF3gkK6Gcwb98atNhcW ehsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mvsh0Cn0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a626406000000b00535ed30d44esi16387361pfb.78.2022.08.24.09.10.12; Wed, 24 Aug 2022 09:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mvsh0Cn0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237880AbiHXPya (ORCPT + 99 others); Wed, 24 Aug 2022 11:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236884AbiHXPy1 (ORCPT ); Wed, 24 Aug 2022 11:54:27 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9511972EF0; Wed, 24 Aug 2022 08:54:26 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id m2so5598954qvq.11; Wed, 24 Aug 2022 08:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=JayAHS+OuNb+tyTryqcDsCuLA5dC38MXJtz38feqpuE=; b=mvsh0Cn0VLETNnxcOhwecAeKWzrUuHEJAjYg2OvijsY66ETjWMmCMPZ2KuXInqdkz1 RB47XLKzF7x7ht1pCdHpZQjCcFv+2hPpcRBJy4bcat6lg0KZ9KrZ/0lthw9G+fPOCWFw EOL5Fgm9PdeZrUks6F/BLJLKxb4re6P9+oGJiak+gHiDc9ccWfvRFGVHXWzh5VNxO9+P zFSFJ6i3kj+YIP2kQLnaHI/T0rmQ5Cw69jqteao/Y2n6WQPrhsKi8/jKB4hzHkafF5Rq jn7UAyu3Usfog7HcngwlAHPVX6tne8iTvUtT1jux4E4LOEEe8isy98BVoK1++t3LxbH9 RMeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=JayAHS+OuNb+tyTryqcDsCuLA5dC38MXJtz38feqpuE=; b=HHMduJoP39M9/1UNIx8JFC5BAX/B4cmHz3yKJsirFyQHsTLhj1PFXVqiY3aUrrV8oE NtT7JgBe0VXy7odcGx/KZYDKtqkeU42RYr+g49qh5SHL5nUmZFYAROPHmG7nu9QiKJHR 9252mZr7pGeUocTMte4QwR4UgWlgoL66zm/JVIIfbCaLvsxUfGChm8MCkRjNXz0Tguns XItwdRh7hMREAMXsf/je4ZFt5roGsuy2LKmxuIJK3Z+dsK7Plca/RUiySO1Ag3UDoeO1 SAUjFdlOyTkBhFmSnfWbJVJzznX2//KlHKWdM3H+EdIQo4OyGmO2Sl0A1j2yycOA7HRN 3JZw== X-Gm-Message-State: ACgBeo2I4T0Sc/cKGYIs6GFZhvNsQkqxv/uhNQPt4NOMbjiau0X4rZfC MmOdLiK5YBHxjwQrmZcMJsSVwRyxANR8oeBCNuMyNBbGwww= X-Received: by 2002:a05:6214:29c2:b0:497:8b2:442 with SMTP id gh2-20020a05621429c200b0049708b20442mr6434328qvb.97.1661356465737; Wed, 24 Aug 2022 08:54:25 -0700 (PDT) MIME-Version: 1.0 References: <20220824131428.31904-1-henning.schild@siemens.com> In-Reply-To: <20220824131428.31904-1-henning.schild@siemens.com> From: Andy Shevchenko Date: Wed, 24 Aug 2022 18:53:49 +0300 Message-ID: Subject: Re: [PATCH v2] leds: simatic-ipc-leds-gpio: make sure we have the GPIO providing driver To: Henning Schild Cc: Andy Shevchenko , Pavel Machek , Lee Jones , Linux LED Subsystem , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2022 at 4:27 PM Henning Schild wrote: > > If we register a "leds-gpio" platform device for GPIO pins that do not > exist we get a -EPROBE_DEFER and the probe will be tried again later. > If there is not driver to provide that pin we will poll forever and also not --> no > create a lot of log messages. > > So check if that GPIO driver is configured, if so it will come up > eventually. If not we exit our probe function early and do not even not, we > bother registering the "leds-gpio". This method was chosen over "Kconfig > depends" since this way we can add support for more devices and GPIO > backends more easily without "depends"ing on all GPIO backends. "depends":ing The code is fine from my perspective, Reviewed-by: Andy Shevchenko thanks! > Fixes: a6c80bec3c93 ("leds: simatic-ipc-leds-gpio: Add GPIO version of Siemens driver") > Signed-off-by: Henning Schild > --- > drivers/leds/simple/simatic-ipc-leds-gpio.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.c b/drivers/leds/simple/simatic-ipc-leds-gpio.c > index 4c9e663a90ba..0c96ba98e338 100644 > --- a/drivers/leds/simple/simatic-ipc-leds-gpio.c > +++ b/drivers/leds/simple/simatic-ipc-leds-gpio.c > @@ -57,6 +57,8 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) > struct gpio_desc *gpiod; > int err; > > + if (!IS_ENABLED(CONFIG_PINCTRL_BROXTON)) > + return -ENODEV; > gpiod_add_lookup_table(&simatic_ipc_led_gpio_table); > simatic_leds_pdev = platform_device_register_resndata(NULL, > "leds-gpio", PLATFORM_DEVID_NONE, NULL, 0, > -- > 2.35.1 > -- With Best Regards, Andy Shevchenko