Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1496295pxb; Thu, 16 Sep 2021 08:39:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD+jT43mKehvOoPzVzglCW57bgI1Q+jvX7ipnDJDk5djlg8+s90N7SCOJhy2iGpcGGUrC5 X-Received: by 2002:a50:e004:: with SMTP id e4mr7261489edl.164.1631806748300; Thu, 16 Sep 2021 08:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806748; cv=none; d=google.com; s=arc-20160816; b=ffDZN+uIV+0OioGFvypW6F6Naul/LIkwr4yeCDXtU3kM4PSVGsNi0cXF5LHxv33Xic 2gRgb1qzvzdfMGKLQIIoeZJqlVctlkWs50Wyoibl9uA0JdSd6iaV3qAg0md4+UrLfceY R0kXdMuyA5FixeRP2Vz4TUaEsgXFcy14gOVtErBmVanq/IR1CWurR5ALCAWe0uZcN2/x u7R2ZESHecf5hjtUj80OIrbWKMSCNVUSWmcIVudxr9Betj2l88Ul5GZwKPn+U7ZZAL6n dNw0hy1lthX3HOjDrqETiGkQnocGIvY5XxbHkt/2DDPwG9ZO1dRCGVh+Y9vPw9x2En9a qzWw== 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=xcUSs4duQ+blsAkS8Q5Pcb/bnyo55bADGMSvPIC+Hh8=; b=OgF40SnChvz4vY0yqnOA7DYfhaEBYtanFkKPz00z9O1OGCf3H01t9/NRIjFgi4ETGt Tz3mMWZtsupE0FQ7HVehYx8bS8sQFbO/N6DW9acCgzSsZ251+AsTkZYBEMFxbA8YJ1QO zXDEs63isUjw+GE6x7964Znqt4ueOE9GVBDQXwh6ahdM+K4L7qqq7UhphdX37prwpMyP 5k5R4tN8uMdqg/DanxI8V8kq9XJgN+0qwhfR/HcZjX6vDJO4J/S1y92tH8bzCvr5tZpw 0CRd2SQxS7ljwatjdSP3Pp2b/w6hFOgccIALTQ2W9QbzngAj8rr8om2yqaw5TSR8GJZ1 i7Ww== 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 kl24si4100344ejc.190.2021.09.16.08.38.43; Thu, 16 Sep 2021 08:39:08 -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 S232100AbhIPPfW (ORCPT + 99 others); Thu, 16 Sep 2021 11:35:22 -0400 Received: from mx22.baidu.com ([220.181.50.185]:34812 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239557AbhIPPfR (ORCPT ); Thu, 16 Sep 2021 11:35:17 -0400 Received: from BC-Mail-Ex17.internal.baidu.com (unknown [172.31.51.11]) by Forcepoint Email with ESMTPS id 1B23A6D55A6DBB914D34; Thu, 16 Sep 2021 23:33:54 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex17.internal.baidu.com (172.31.51.11) 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:33:53 +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:33:53 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , , Subject: [PATCH] Input: pxa27x_keypad.c - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:33:47 +0800 Message-ID: <20210916153348.14893-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/keyboard/pxa27x_keypad.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index a7f8257c8a02..9e72bcdd864a 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -754,10 +754,9 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) return PTR_ERR(keypad->mmio_base); keypad->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(keypad->clk)) { - dev_err(&pdev->dev, "failed to get keypad clock\n"); - return PTR_ERR(keypad->clk); - } + if (IS_ERR(keypad->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(keypad->clk), + "failed to get keypad clock\n"); input_dev->name = pdev->name; input_dev->id.bustype = BUS_HOST; -- 2.25.1