Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15069419rwd; Sun, 25 Jun 2023 09:30:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mh5GnGPfnBxVqLuCgbTrB8Zr/AnuR8OKVpiFsyPFUHPQCDhUos62hLqFRMKQLI6evhJ1f X-Received: by 2002:a17:906:76cf:b0:98d:d455:8312 with SMTP id q15-20020a17090676cf00b0098dd4558312mr3548689ejn.7.1687710636244; Sun, 25 Jun 2023 09:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687710636; cv=none; d=google.com; s=arc-20160816; b=Ee7OfpItzsU96lu+/T3SSNonG4RLxpdUvBSq5FEVpxsemCY7+5kqJ11Z98ck5/J23X 40LSTh6EMy72w+ZZ8+TwfwtNIOTvyvBd89RwcQGLR+gqjapJW0vQage9UYaXBmMwnwVd trEDxXEnEEnaEkQZNuhR6B5GmdENCPuqeQ05Pgj1LrFHTt80PKOLHzr8Fejz6Jh3TsGs GSGu7ijKW+87FMIXB1cZJgwHbEGoqPHu1Od4QdYrN0d6xFFN2bGD2tygOjkAkNIqxf1V gUvQkb2q3MSOKD8Zk2GdSk8CG2P8TWu0Ej59ixpE3tntZedtt1k13OfqUdmqKCtQK7fj TMeQ== 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=8ZvbC3ZPt55NmPj9EWoBgNDeYcxlZ+9WZ1c1ZpUtvDs=; fh=9JCOumVf9dngCFHiV6Hmkcm2vnKQxEc42icPYm2blNQ=; b=uZTv8SxZchEdhEpG1OuQY2WklsYUCKqBCQzdMRf0NKUF6XJQv3QtRbmDDIlt1hYoyk Hpf1NIq8FUYC4hOoGHP8Mfh0oCHKP5BZBGqKZ2lN5+PSyH1kUWQsekNU0A15sBVMMc8A depSw6VqHcdfyXO1Rks/YyCOET3POq/9/5bkxjoHSHXSfzqifGP13VdUy82Uu2w9cCno WNCzEtNgQQPNTuBpvJJRLWaJCwj2rxz3qg7tN7SDDx38dj8WdO63iGIz9noWPv32jzCR jq+h46qJx4fYKcuS8hAhbskZt9Z23CEp76xQAtbN/v/mTS4esN4wIlmCCKEo+puO4TG1 ZasQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V3MOXov5; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z23-20020a1709064e1700b009829cb69a02si1915082eju.1034.2023.06.25.09.30.10; Sun, 25 Jun 2023 09:30:36 -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=@linaro.org header.s=google header.b=V3MOXov5; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbjFYQ23 (ORCPT + 99 others); Sun, 25 Jun 2023 12:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbjFYQ21 (ORCPT ); Sun, 25 Jun 2023 12:28:27 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCC59194 for ; Sun, 25 Jun 2023 09:28:25 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-98e1d3be004so115156066b.1 for ; Sun, 25 Jun 2023 09:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687710504; x=1690302504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8ZvbC3ZPt55NmPj9EWoBgNDeYcxlZ+9WZ1c1ZpUtvDs=; b=V3MOXov53g3ZDu8LrcB6yeY3mCKfLjTgv8aERjwD6ZwjRyP74+miUwM/OWlxgCKtyN y5wq3vW9LNqZVFmyctn9GDTylK7ShRLmGWcdy+i+YlPhORyLkho48YWmPhhCleBCCCOk lwwtwGBnoej1wmCBzbqv7hFR+DTmWUo3VXJUSeq1HsyCcGTx70//ycUCBodR3Pj0qrWG ym3Q1M+U8QonDF9G5KdwgsFkRYl4/qvsnZLaKo2u00CCq7gRiYZCc5Co46UzgreV43Q8 J3NwB5fTLMaoAlsrWzVbnhIYn6kQHgU6/s1zvgFnLSXw15nBxsibJAo+WA3HqzDn3IIk HTPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687710504; x=1690302504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ZvbC3ZPt55NmPj9EWoBgNDeYcxlZ+9WZ1c1ZpUtvDs=; b=FTliZXt4QCjxlQjtPwmb/2t4cRgwNhkLgiSIGbjDGjmLhpyiTmCufwf7D7Vg+eal99 vYpprLkcnxfdGw6qMi35bGGQZ5j+Z6jqV2jo0CMJwjKGnP5YotG2Bo8LjFtI3N7VLzoY qcZSi19b0uaVS1x7WYRt2ee/2ksYBNtTfDc6oRHdslDx1v9lLm5MNd+6HeZ6fONn2hM0 7jqbndjUKtVr+kqrCNKf8OVvsspGP8g//HORTEzU4i7bzdksuHKvfuptGf5efICrVF9/ qJTis7LJLVyUWOfi8Yr6rKKWWKWR3o6HkjU0l8innz9VHqBQYRmuSutxQN8mPVpNnLFX f24w== X-Gm-Message-State: AC+VfDxpu7M/tdG3CVNbPQkAoOna5KBJYLfxq1GQgnct5KDgATRDESuY 0SrUrdq+4ylB7IJ5AGmO/L81Hw== X-Received: by 2002:a17:907:8688:b0:973:e349:43c8 with SMTP id qa8-20020a170907868800b00973e34943c8mr23825334ejc.69.1687710504335; Sun, 25 Jun 2023 09:28:24 -0700 (PDT) Received: from krzk-bin.. ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id ec10-20020a170906b6ca00b00982be08a9besm2277731ejb.172.2023.06.25.09.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 09:28:23 -0700 (PDT) From: Krzysztof Kozlowski To: Dmitry Torokhov , Hans de Goede , Linus Walleij , Bastien Nocera , Sangwon Jee , Eugen Hristev , =?UTF-8?q?Mika=20Penttil=C3=A4?= , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Andi Shyti , Andy Shevchenko , Krzysztof Kozlowski , Andy Shevchenko Subject: [PATCH v4 01/24] Input: gpio_keys_polled - Simplify with dev_err_probe() Date: Sun, 25 Jun 2023 18:27:54 +0200 Message-Id: <20230625162817.100397-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230625162817.100397-1-krzysztof.kozlowski@linaro.org> References: <20230625162817.100397-1-krzysztof.kozlowski@linaro.org> 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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/input/keyboard/gpio_keys_polled.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index c3937d2fc744..ba00ecfbd343 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -299,13 +299,9 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) NULL, GPIOD_IN, button->desc); if (IS_ERR(bdata->gpiod)) { - error = PTR_ERR(bdata->gpiod); - if (error != -EPROBE_DEFER) - dev_err(dev, - "failed to get gpio: %d\n", - error); fwnode_handle_put(child); - return error; + return dev_err_probe(dev, PTR_ERR(bdata->gpiod), + "failed to get gpio\n"); } } else if (gpio_is_valid(button->gpio)) { /* -- 2.34.1