From patchwork Thu May 5 15:25:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 570623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B988C433F5 for ; Thu, 5 May 2022 15:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238594AbiEEP3S (ORCPT ); Thu, 5 May 2022 11:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381325AbiEEP3O (ORCPT ); Thu, 5 May 2022 11:29:14 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FA1912AB7; Thu, 5 May 2022 08:25:34 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 129so2871794wmz.0; Thu, 05 May 2022 08:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yLBoSbardbjKzXlK7cUTAZT7oQyC5cdV78AVWhwvXUo=; b=pZrqFtC4+HbRG+ge+WDczNxBseJ4feE/uYnTzO9hxzDIaZilNSNrYCRj0/IPwA7RyJ kWj3ye2KT2Bx/Gk4SliLi/FF9EWx8L1vpwFglDHoU0sEZmQw1igNqiusATyeKnobN2l8 PVS5xR7xDe7Rp++5sK2QGVs7ZOD5agQmTDbgotn0i/GPRvhwicEq1YXeYXjuOiLo88ns vB/21VHEjoEuS7GzGcXmuy8gHqYUtIBTeu2WfxBB2MsclFr8U/LrE/nY4pjTjpqUHfZc BpcOSsPDFOkPK8kL+Cd0wsLRKJwbtzuUfUycwbejnvRoyjeZb3CvkgyUl/8bGF/qwZSI AtGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yLBoSbardbjKzXlK7cUTAZT7oQyC5cdV78AVWhwvXUo=; b=p7dJ7NxMCCwlsqSkRarieFGudSMOuY/2mn+2JgUAApetPp0G4f/Y0V8try2fI5WWtl HT1GPl1ExnSRPu2HEXfzUNdD5nibkxgVkv4d5nkPIuxo4td8tk/aBlGmaSbh1unLUHhb 223CIg7oOmcPqoCQs+bm9g66u5UpksarRfyvxPgQTQaxyzTRr9OUnJXMXUGCDVW3vGAz rzPyygRhXqHw341wSTR47VGW2ce4gzFWL/zbpfFAsomlvUwUTQo+bi6LzzLzMOJ10qA6 U0z9cyq/Ov8DNHJ4GBqguwOwDYlYBKzvaU0pBixVr3HvpdsA24oATy2grrwsHY7JoWfM WDtQ== X-Gm-Message-State: AOAM5322Ybs1nCx9mdOP0xNSeSev5RgPYHC+iU3SF/eZWy8rjrCOqzIp 9X3bzRLB4iFRmlNdw6pEvxkHP+ekZii43Q== X-Google-Smtp-Source: ABdhPJzDQcNtHYCYmlbuo41WROkkbv/6djDeJIgLcpbfEt0FAYFxmgTTdtyOu0RnRK6SgyqXECoQfg== X-Received: by 2002:a7b:cd98:0:b0:394:2431:2393 with SMTP id y24-20020a7bcd98000000b0039424312393mr5426664wmj.122.1651764332687; Thu, 05 May 2022 08:25:32 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id h12-20020a05600016cc00b0020c5253d8e4sm1578679wrf.48.2022.05.05.08.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 08:25:32 -0700 (PDT) From: Markuss Broks To: pavel@ucw.cz Cc: Markuss Broks , Rob Herring , Krzysztof Kozlowski , Linus Walleij , Lad Prabhakar , Andy Shevchenko , Christophe JAILLET , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 1/3] leds: ktd2692: Avoid duplicate error messages on probe deferral Date: Thu, 5 May 2022 18:25:16 +0300 Message-Id: <20220505152521.71019-2-markuss.broks@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220505152521.71019-1-markuss.broks@gmail.com> References: <20220505152521.71019-1-markuss.broks@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Use dev_err_probe instead of dev_err to avoid duplicate error messages if the GPIO allocation makes the probe defer. Signed-off-by: Markuss Broks --- drivers/leds/flash/leds-ktd2692.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/leds/flash/leds-ktd2692.c b/drivers/leds/flash/leds-ktd2692.c index ed1f20a58bf6..8b99742cb68a 100644 --- a/drivers/leds/flash/leds-ktd2692.c +++ b/drivers/leds/flash/leds-ktd2692.c @@ -279,17 +279,13 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS); ret = PTR_ERR_OR_ZERO(led->ctrl_gpio); - if (ret) { - dev_err(dev, "cannot get ctrl-gpios %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n"); led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS); ret = PTR_ERR_OR_ZERO(led->aux_gpio); - if (ret) { - dev_err(dev, "cannot get aux-gpios %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n"); led->regulator = devm_regulator_get(dev, "vin"); if (IS_ERR(led->regulator)) From patchwork Thu May 5 15:25:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 570068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35C2CC43217 for ; Thu, 5 May 2022 15:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381341AbiEEP3U (ORCPT ); Thu, 5 May 2022 11:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381289AbiEEP3T (ORCPT ); Thu, 5 May 2022 11:29:19 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9741B13F83; Thu, 5 May 2022 08:25:38 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id m62so2867452wme.5; Thu, 05 May 2022 08:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZT7VKniHc2GWnckoL6MlPZLbnEyYu3dBdYD4+s+IxsM=; b=C8t6mAJCq+WIzOm3ph6BRBIpkmNzO8S5iLhTHSeH70Hjw+nsvjx4OkIpVE9A750j/A d5dDN1kPWKbiHu3nm/VibKzPwTwXuAElwpwUcqHfdYdIfCzWfcFEbEeobLzdrflybnBF BWr6q/MXeVmXPGb0a7X2frx9VYl7kdMMQfY95cy8u/Z8cfe9VYe7HVcQxpwMT+dgpXCe ZkBTFz19lmo9sMAa7uX1EDr5/Nl8z2s6756jrM87n6R275ETab+705H9P//tHXYFT+OK xV5GydmBDul8Zgi9TW1+6KtxXtH8G8eddMfqbt3EU8tTOjhKzMFFEyXU6eqIsVCCMMAE i+lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZT7VKniHc2GWnckoL6MlPZLbnEyYu3dBdYD4+s+IxsM=; b=edotFQiADyuQyGFbTSls1PWFCB8jddGPA6W4Bg3RPjfwfMMH1bLcM1Rb6088m31Zd/ oEUSIVa2jdf4V+uwRm5Ba1mP5MxOrFfOQA3nVaf9b8dMKq0MpzK5Clzp9c9NJhCEo2Bs Gszhjn2/wFD3LrBgJqogzgMN67RH/3V/xlZtM7q6Zx0jYKyVaPeQY2TQeLivbMgQUJdD 8sjCkCO2MEAoq3cbBhaFOMGHoO3lsf/y6EmYzpuOIGr6x6ut0U5go8ROiy+vXXZAsRlw 1LACoTKNGiScEPKc22FlPArVAPlAAX1JazyH6i+wkXMQd0MdUxV1eVzJ0zsKVHx+y/n1 VVFQ== X-Gm-Message-State: AOAM530YZrZKUnHwQc9Ghdlr8hFduE4Ddfm6kKzBdCVZRepLqNZmBopo bki7KzkN0/z6O3E4vassHdA= X-Google-Smtp-Source: ABdhPJyMfXNkPjZccwCM1iYOKjcd6z2zdTI0eKyvKaqZuV96XO0gnkHHYm3w65F32UNamNDCeYQDUQ== X-Received: by 2002:a05:600c:3b9e:b0:394:69e2:267a with SMTP id n30-20020a05600c3b9e00b0039469e2267amr3559662wms.35.1651764337184; Thu, 05 May 2022 08:25:37 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id h12-20020a05600016cc00b0020c5253d8e4sm1578679wrf.48.2022.05.05.08.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 08:25:36 -0700 (PDT) From: Markuss Broks To: pavel@ucw.cz Cc: Markuss Broks , Rob Herring , Rob Herring , Krzysztof Kozlowski , Christophe JAILLET , Linus Walleij , Lad Prabhakar , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 2/3] dt-bindings: leds: convert ktd2692 bindings to yaml Date: Thu, 5 May 2022 18:25:17 +0300 Message-Id: <20220505152521.71019-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220505152521.71019-1-markuss.broks@gmail.com> References: <20220505152521.71019-1-markuss.broks@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This patch converts the leds-ktd2692.txt bindings to modern yaml style device-tree bindings. Reviewed-by: Rob Herring Signed-off-by: Markuss Broks --- .../bindings/leds/kinetic,ktd2692.yaml | 87 +++++++++++++++++++ .../devicetree/bindings/leds/leds-ktd2692.txt | 50 ----------- 2 files changed, 87 insertions(+), 50 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/kinetic,ktd2692.yaml delete mode 100644 Documentation/devicetree/bindings/leds/leds-ktd2692.txt diff --git a/Documentation/devicetree/bindings/leds/kinetic,ktd2692.yaml b/Documentation/devicetree/bindings/leds/kinetic,ktd2692.yaml new file mode 100644 index 000000000000..bac95a51afa1 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/kinetic,ktd2692.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/kinetic,ktd2692.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: KTD2692 Flash LED Driver from Kinetic Technologies + +maintainers: + - Markuss Broks + +description: | + KTD2692 is the ideal power solution for high-power flash LEDs. + It uses ExpressWire single-wire programming for maximum flexibility. + + The ExpressWire interface through CTRL pin can control LED on/off and + enable/disable the IC, Movie(max 1/3 of Flash current) / Flash mode current, + Flash timeout, LVP(low voltage protection). + + Also, When the AUX pin is pulled high while CTRL pin is high, + LED current will be ramped up to the flash-mode current level. + +properties: + compatible: + const: kinetic,ktd2692 + + ctrl-gpios: + maxItems: 1 + description: Specifier of the GPIO connected to CTRL pin. + + aux-gpios: + maxItems: 1 + description: Specifier of the GPIO connected to CTRL pin. + + vin-supply: + description: LED supply (2.7V to 5.5V). + + led: + type: object + $ref: common.yaml# + description: Properties for the LED. + properties: + function: true + color: true + flash-max-timeout-us: + description: Flash LED maximum timeout. + + led-max-microamp: + maximum: 300000 + description: Minimum Threshold for Timer protection + is defined internally (Maximum 300mA). + + flash-max-microamp: + maximum: 300000 + description: Flash LED maximum current + Formula - I(uA) = 15000000 / Rset. + + additionalProperties: false + +required: + - compatible + - ctrl-gpios + - led + +additionalProperties: false + +examples: + - | + #include + #include + + ktd2692 { + compatible = "kinetic,ktd2692"; + ctrl-gpios = <&gpc0 1 0>; + aux-gpios = <&gpc0 2 0>; + vin-supply = <&vbat>; + + led { + function = LED_FUNCTION_FLASH; + color = ; + flash-max-timeout-us = <250000>; + flash-max-microamp = <150000>; + led-max-microamp = <25000>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/leds/leds-ktd2692.txt b/Documentation/devicetree/bindings/leds/leds-ktd2692.txt deleted file mode 100644 index 853737452580..000000000000 --- a/Documentation/devicetree/bindings/leds/leds-ktd2692.txt +++ /dev/null @@ -1,50 +0,0 @@ -* Kinetic Technologies - KTD2692 Flash LED Driver - -KTD2692 is the ideal power solution for high-power flash LEDs. -It uses ExpressWire single-wire programming for maximum flexibility. - -The ExpressWire interface through CTRL pin can control LED on/off and -enable/disable the IC, Movie(max 1/3 of Flash current) / Flash mode current, -Flash timeout, LVP(low voltage protection). - -Also, When the AUX pin is pulled high while CTRL pin is high, -LED current will be ramped up to the flash-mode current level. - -Required properties: -- compatible : Should be "kinetic,ktd2692". -- ctrl-gpios : Specifier of the GPIO connected to CTRL pin. -- aux-gpios : Specifier of the GPIO connected to AUX pin. - -Optional properties: -- vin-supply : "vin" LED supply (2.7V to 5.5V). - See Documentation/devicetree/bindings/regulator/regulator.txt - -A discrete LED element connected to the device must be represented by a child -node - See Documentation/devicetree/bindings/leds/common.txt - -Required properties for flash LED child nodes: - See Documentation/devicetree/bindings/leds/common.txt -- led-max-microamp : Minimum Threshold for Timer protection - is defined internally (Maximum 300mA). -- flash-max-microamp : Flash LED maximum current - Formula : I(mA) = 15000 / Rset. -- flash-max-timeout-us : Flash LED maximum timeout. - -Optional properties for flash LED child nodes: -- label : See Documentation/devicetree/bindings/leds/common.txt - -Example: - -ktd2692 { - compatible = "kinetic,ktd2692"; - ctrl-gpios = <&gpc0 1 0>; - aux-gpios = <&gpc0 2 0>; - vin-supply = <&vbat>; - - flash-led { - label = "ktd2692-flash"; - led-max-microamp = <300000>; - flash-max-microamp = <1500000>; - flash-max-timeout-us = <1835000>; - }; -}; From patchwork Thu May 5 15:25:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 570067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB89AC433FE for ; Thu, 5 May 2022 15:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381301AbiEEP30 (ORCPT ); Thu, 5 May 2022 11:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381319AbiEEP3X (ORCPT ); Thu, 5 May 2022 11:29:23 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92E41E3D8; Thu, 5 May 2022 08:25:42 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id b19so6567451wrh.11; Thu, 05 May 2022 08:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3ybTkx6rA0JAuYcJUqRmvgRvg+0luA63XlWmRsPCeM8=; b=dJ8cydMX9FOIbOpK9JdIwEQdc9E34teovf6xkKcexTYYvZ/UEltM7h1R3IYfKxZE/V nuVWteafrtfSMQScAdqAis9KGXsueSB3PfChG9hYNDveQ9Wy3+eXjGAgSemZgU4Wm7mW D+dYd1E1jVLYH50sjhw4yg9kbGXS5RgTV7wY+9Nl14Gt6UuuWNFFHbxaoHkR7UVXq8UJ qfgUiZ/qI1E38VT5pnjOfG9is+dGwjij7Jacs+BDI5oAsbX9f8RKubMsfW1R5LCWYgAH MaWNIJz7WF06iMPhnhQeprmwe68LzNQ68tGyXprxK9+uGCe7myTg7PiBWQK68VL4eAtb n/pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3ybTkx6rA0JAuYcJUqRmvgRvg+0luA63XlWmRsPCeM8=; b=RavYU8F7myoilyoMi283zohDsDQ4ryIk48mpuovSYwco5O3uJRgRzNKns8XpzV5B0t PwirFmZ4eB9kJ0hF2KUq/gYv9fltIxR5IQjLsQljkI7nnE6KIZS7BWfFcg19K4ixW+xL cBsVVvGZ+/kUHVj9nmOQVJSodv0+4e52co1LVKmsooYngFt/FMhhWTDlp5t4+i/CFWPV fHgHElUJXK/6Iox1EYFgt6VjLLlXCS57gJRvT8/+DHNtqgEiuVYDKOSnXxUlPdB2io0G RLrI7hSXC+D2Ol4aFUYqs58hFT0lkWmd4p3VsjRDP3TGScaId1iCLniMDHO7INn3vLFV GOTA== X-Gm-Message-State: AOAM531zwEKE4LW9kMj3BnvOIFxvdWx0mMVeFEFKV2sob5WKxlGQ0TWR mqJZISC6iVd3Cr+9wBc2N00= X-Google-Smtp-Source: ABdhPJw0l6J7pD3el/9XgOffymMj9tx4ej6pWGw53HaiHwRn+AC4bVz9CUr3R4YeQ2N7FKERq6fRLg== X-Received: by 2002:a5d:53c5:0:b0:20a:cf17:717c with SMTP id a5-20020a5d53c5000000b0020acf17717cmr21071578wrw.252.1651764341406; Thu, 05 May 2022 08:25:41 -0700 (PDT) Received: from nergzd-desktop.localdomain ([194.39.226.133]) by smtp.gmail.com with ESMTPSA id h12-20020a05600016cc00b0020c5253d8e4sm1578679wrf.48.2022.05.05.08.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 08:25:40 -0700 (PDT) From: Markuss Broks To: pavel@ucw.cz Cc: Markuss Broks , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Lad Prabhakar , Linus Walleij , Christophe JAILLET , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 3/3] leds: ktd2692: Make aux-gpios optional Date: Thu, 5 May 2022 18:25:18 +0300 Message-Id: <20220505152521.71019-4-markuss.broks@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220505152521.71019-1-markuss.broks@gmail.com> References: <20220505152521.71019-1-markuss.broks@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Make the AUX pin optional, since it isn't a core part of functionality, and the device is designed to be operational with only one CTRL pin. Reviewed-by: Andy Shevchenko Signed-off-by: Markuss Broks --- drivers/leds/flash/leds-ktd2692.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/leds/flash/leds-ktd2692.c b/drivers/leds/flash/leds-ktd2692.c index 8b99742cb68a..670f3bf2e906 100644 --- a/drivers/leds/flash/leds-ktd2692.c +++ b/drivers/leds/flash/leds-ktd2692.c @@ -282,9 +282,8 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, if (ret) return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n"); - led->aux_gpio = devm_gpiod_get(dev, "aux", GPIOD_ASIS); - ret = PTR_ERR_OR_ZERO(led->aux_gpio); - if (ret) + led->aux_gpio = devm_gpiod_get_optional(dev, "aux", GPIOD_ASIS); + if (IS_ERR(led->aux_gpio)) return dev_err_probe(dev, PTR_ERR(led->aux_gpio), "cannot get aux-gpios\n"); led->regulator = devm_regulator_get(dev, "vin");