From patchwork Mon Sep 7 20:40:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 255008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D41BC43461 for ; Mon, 7 Sep 2020 20:41:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37ECB21556 for ; Mon, 7 Sep 2020 20:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727962AbgIGUkw (ORCPT ); Mon, 7 Sep 2020 16:40:52 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43996 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726732AbgIGUkv (ORCPT ); Mon, 7 Sep 2020 16:40:51 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 7784A290B21 Received: by jupiter.universe (Postfix, from userid 1000) id 0B999480117; Mon, 7 Sep 2020 22:40:47 +0200 (CEST) From: Sebastian Reichel To: Dmitry Torokhov , =?utf-8?q?Myl=C3=A8ne_Jos?= =?utf-8?q?serand?= , Rob Herring Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv2 3/4] Input: rotary-encoder - Use dev_err_probe Date: Mon, 7 Sep 2020 22:40:44 +0200 Message-Id: <20200907204045.95530-4-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200907204045.95530-1-sebastian.reichel@collabora.com> References: <20200907204045.95530-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Simplify driver a bit by making use of dev_err_probe. Signed-off-by: Sebastian Reichel --- drivers/input/misc/rotary_encoder.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index e9a5dbb10513..16ad86fad7cb 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c @@ -241,12 +241,8 @@ static int rotary_encoder_probe(struct platform_device *pdev) device_property_read_bool(dev, "rotary-encoder,relative-axis"); encoder->gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); - if (IS_ERR(encoder->gpios)) { - err = PTR_ERR(encoder->gpios); - if (err != -EPROBE_DEFER) - dev_err(dev, "unable to get gpios: %d\n", err); - return err; - } + if (IS_ERR(encoder->gpios)) + return dev_err_probe(dev, PTR_ERR(encoder->gpios), "unable to get gpios\n"); if (encoder->gpios->ndescs < 2) { dev_err(dev, "not enough gpios found\n"); return -EINVAL;