Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3247311iob; Fri, 6 May 2022 23:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY6ndzd9jaKXZGmGNkJi5b7nQfU6tBARk1Du0Acwwv0HJcDhYgSIE93x5RsQBJ4wctjKf+ X-Received: by 2002:a17:906:99c5:b0:6df:8215:4ccd with SMTP id s5-20020a17090699c500b006df82154ccdmr6427569ejn.684.1651906353402; Fri, 06 May 2022 23:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651906353; cv=none; d=google.com; s=arc-20160816; b=zXkZrqscAxfDa7rO5iHZNbWKGWCefNyAKS1hbngRtFL1yG3F1/lbOhUFRSk4cFmurP XV3uGgbBFFX+K3JOOA3jH6spGxm3typpzQ15+J1/XUeytISTiJDsMD5UG0rwALW4PiHA k5blkJIgL0BmAtQqLXooXjC5uXh+b69YKe2iMQ5KD3R1gG81B4/z6K1d4ZC/BYluOUrr QTtV6b805VoMnPZH6EPe9HaLrnHcXCRxBt8VlmkcZVgC/9cHjKOr9ZVmgUCr9k1yofHo vByqwMy85TUYGsoWqz1kvHnpsUJcvR7Yz7FjcU/O8i62cAipJK+YS91bExBMMCpkzSzl S3ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yLBoSbardbjKzXlK7cUTAZT7oQyC5cdV78AVWhwvXUo=; b=DNbeRg8/M9wuDG/hyEaCIk79vlqCWpp98hMN8PVYuS3nhC8cZkuFE8QgtgFu73tknf cFu6JZZzyA3GfmG8L2zeaVXeK7/KTSCd1xxf5MEWqi8w/mN3cOVSrxUcXkeyh67XynXj w6597L+C6OiUTciJ2R+72xLgZ0ieezGRnDz90dGPKs5epg0AtOxvnTAnFGn3EbJbabBq 7WVevmagH3u57ohmX8y9DMfUb+FFahBV0jETpK+O1m45ft1xec70/pXWU1bFtM9uP5cH HW0CBQUNAiZCoQt23yJ2wVU9kBVRcYLAOrV42Nm2zl7ZeW+1TN1CQ99bhrnaalYVgka5 gdmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pZrqFtC4; 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 v9-20020a50d589000000b00425e2b34d08si720034edi.600.2022.05.06.23.52.05; Fri, 06 May 2022 23:52:33 -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=pZrqFtC4; 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 S231313AbiEEP3T (ORCPT + 99 others); Thu, 5 May 2022 11:29:19 -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-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 Content-Transfer-Encoding: 8bit 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 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)) -- 2.35.1