Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1493716pxb; Thu, 16 Sep 2021 08:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymr32Io3tFBRNHsyfwzZK5yHxC2NZRZy/85lH/k6cEjXQ4vaC7LERm8IaYVjBAzxj8E/uk X-Received: by 2002:aa7:ca19:: with SMTP id y25mr7017910eds.197.1631806549744; Thu, 16 Sep 2021 08:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806549; cv=none; d=google.com; s=arc-20160816; b=y7EBKI75N0pq8jYmMwCX9nLgiJr13USvHt9JKYYjfOb+uXpZIZ9SF22KwBuRbUZq1Y sY/33k5asPlCc82oTREcVUlHoXUAidAdcQS492BCK+7IZlrOGlK/YpZASLHxIxTejtiu PqJFXKMudgf5uUBz3cgQy4690+4eYmUf+Oa3rACXovGX6MqREaAp4c4GpMruZFSHDe2M 94Tf/hb4nj/RLqw90GD42berQ8FNMx7mhpuX98f3WmxLf37qb5xMJg0fufLKxCuvCr7t 2245y0o+ypJfLT0kwtBOA/TyPhWDq5jdFQwf+K2amlL8p1/I2ZWTK8dU6hwXiPlFtxul v0hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=JGdtYsg1ttFQ28P+z71bo67L74vgPVbJ+5uS67m0FiE=; b=rr/A/UJlPy9rdaTauZJAmdKZcu0mjRIRZSr0BXBePonLf0d+rd3xdVenRp/PqnkZbZ PZQKO9Vkg2baSFfUWPv3BYLAo5Jvb12tlB+3/DVWBkJx+0WnQuQWM7zqywK1zl7boLOE tR0Lxhxn6VnBiyF5fsO+Ak6cpLBBNKyhPBUR0yLDTWwh2KlVLizdQhHKQ06T6q7Kd5Jw Dh/ROppadzBVul42DSuSLXGzZhUAP/32ys8U0Se+MrCrlVoaYGi6JXI6pByBJiB5bgZU 2NrKOyIZHFms0Cau2C7UYTu3xgjRl/eYlZkkLSKJdVJvpxt3o1wUI98/X8w/oCJ9Tzye M43g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si3957943edj.49.2021.09.16.08.35.25; Thu, 16 Sep 2021 08:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239050AbhIPPdz (ORCPT + 99 others); Thu, 16 Sep 2021 11:33:55 -0400 Received: from mx22.baidu.com ([220.181.50.185]:33710 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239340AbhIPPdy (ORCPT ); Thu, 16 Sep 2021 11:33:54 -0400 Received: from BC-Mail-Ex28.internal.baidu.com (unknown [172.31.51.22]) by Forcepoint Email with ESMTPS id 24CED95A706080A020D1; Thu, 16 Sep 2021 23:32:32 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex28.internal.baidu.com (172.31.51.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 16 Sep 2021 23:32:31 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 16 Sep 2021 23:32:31 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , , Subject: [PATCH] Input: gpio_decoder - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:32:25 +0800 Message-ID: <20210916153226.14310-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex09.internal.baidu.com (172.31.51.49) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/input/misc/gpio_decoder.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_decoder.c index 145826a1a9a1..06a45a0df7a3 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -80,10 +80,9 @@ static int gpio_decoder_probe(struct platform_device *pdev) device_property_read_u32(dev, "linux,axis", &decoder->axis); decoder->input_gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); - if (IS_ERR(decoder->input_gpios)) { - dev_err(dev, "unable to acquire input gpios\n"); - return PTR_ERR(decoder->input_gpios); - } + if (IS_ERR(decoder->input_gpios)) + return dev_err_probe(dev, PTR_ERR(decoder->input_gpios), + "unable to acquire input gpios\n"); if (decoder->input_gpios->ndescs < 2) { dev_err(dev, "not enough gpios found\n"); -- 2.25.1