Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1493272pxb; Thu, 16 Sep 2021 08:35:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywzBUOQnZ2X7KTkhOaGzt5mtaYOIdWSS+gUAzRj19JOjHHqJ5JmG+aICvmbk8sgINusQFW X-Received: by 2002:a1c:3845:: with SMTP id f66mr5660257wma.63.1631806516125; Thu, 16 Sep 2021 08:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806516; cv=none; d=google.com; s=arc-20160816; b=hkhGLmuwQ+jxFbGPcDR9troCUSpavfF9wr777/O/jY6geoItFjlVeeBc0MNDbZtp8m MPkXAQ+JAxydQktlNQJxLsLJCcAwWCwKW+/8AWAZnrPWs5fJUnEAmtqtFcEh/IOGwH76 F7Q8RPaYFx11HAQ77FYBWJ1NMF1kGfaPjdsz6riwKRdFDXY5yPufHN9KGYXzp9nf8mph K29OV0qvoXIKZC56/k/lCpX8LvnErckzqasg790GCzbPZYwhgp3wdN64Pn0fV2XZbJxd S++kygr8cdPvezaposoR5mVWF2tEHEy9oB/zA/bpsbbE5ib7ycuCaizz0QfxuqckX7j8 ogEg== 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=AWSVkKqxcTJ/12N9df10Wfqsy7dHg2kYeiXM5EY4JC8=; b=JPiMEt2jC2PdnI6tS7CszUXVHAuekdg/KzD2pX7NslE1b7wpxEmuXgFqa8QD7YCGtz zgYSYc7iPQdiVxGV8K5KDaPRI27GWODV83OZiDTadBFY7KFR+aFJ2LG5pgj9nFuD7I+D kMF/rXLEruRk6jYBz7lhTRpDVSt67LQt5TnM1ikfT7id+D4/Y9jx3ve23xbiYQHdc0/E QO4qAjYNzSiLCneB4w1xAgnOq9MXsN0nSCRVU1PhLBcIQB73/i7cHZGqPrOWWTXpbJnV oHl81YB1jFh3uMCQcH0UbOWiZlIeHxBejclyROyrIaMtCYSD58/iyqmLfdBlaljuBvf+ K4JQ== 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 u20si3870500edv.439.2021.09.16.08.34.52; Thu, 16 Sep 2021 08:35:16 -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 S239173AbhIPPcc (ORCPT + 99 others); Thu, 16 Sep 2021 11:32:32 -0400 Received: from mx22.baidu.com ([220.181.50.185]:60736 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239052AbhIPPcb (ORCPT ); Thu, 16 Sep 2021 11:32:31 -0400 Received: from BC-Mail-Ex12.internal.baidu.com (unknown [172.31.51.52]) by Forcepoint Email with ESMTPS id 08AB82A2362C1ED66C9E; Thu, 16 Sep 2021 23:31:02 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex12.internal.baidu.com (172.31.51.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 16 Sep 2021 23:31:01 +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:31:01 +0800 From: Cai Huoqing To: CC: Michael Hennerich , Dmitry Torokhov , , Subject: [PATCH] Input: ad7879 - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:30:55 +0800 Message-ID: <20210916153056.13674-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-Ex11.internal.baidu.com (172.31.51.51) 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/touchscreen/ad7879.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index e850853328f1..440ebb3fc586 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -494,10 +494,9 @@ static int ad7879_parse_dt(struct device *dev, struct ad7879 *ts) u32 tmp; err = device_property_read_u32(dev, "adi,resistance-plate-x", &tmp); - if (err) { - dev_err(dev, "failed to get resistance-plate-x property\n"); - return err; - } + if (err) + return dev_err_probe(dev, err, + "failed to get resistance-plate-x property\n"); ts->x_plate_ohms = (u16)tmp; device_property_read_u8(dev, "adi,first-conversion-delay", -- 2.25.1