Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1495486pxb; Thu, 16 Sep 2021 08:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrFlM6wf/XSP6E0emvhH3dbN3XGLV3QRGLhGGXvIbXV6XTup8dBk/Y1XSMw0MNKiqZA/eo X-Received: by 2002:a17:906:520b:: with SMTP id g11mr6956350ejm.502.1631806686879; Thu, 16 Sep 2021 08:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806686; cv=none; d=google.com; s=arc-20160816; b=GcBpuPJCBx8nKvxAuWB2B5hSoCPwjtkX8/OJbT/7S9v8n6DrF+2JnnT0tjEzx8Ao8s w3CzqZNEnlKGkk2HqLhPjytza21TeaSp8cEisUkqVHR7h5w5I+c5jmEsJ3+lyRfuCR0X VndmNyXs3yFyudSo2t04vIlrquRyPx1MYdymmhKmp/ZgIMNnpT30voSCg3KVxi065bMs mGd6a00mx/JtL2qqhXbvElaJbWYM0RsBL6Dnv1DP4wGUY1gF9rhcBZo184MB6C7sJXU1 raA3DfmLWBRU1zz8fEgHSw23DwUvEDT/6gEZZ3H0Wz+juEPAU54xDlbwuYX1ZaWOoU+9 hMMw== 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=P9AEvSYN+5Ru8K1IKemCCgWMBcy+gPA3Ie7NkXEQMZo=; b=m+zN6POyF42xzfTe0kvJQMGylsMF8cw3xHz6gOrZm1zL9y/HhbBKEY9VtdSLtI+Y3e /A3X1LUqqsSZrXrqHLk1+DlPlgAFqCIjjq2WtXkWm7afDFUUbeuo5QCAzAau3SYbsCUi ja/8Wdk2bgVgzmKECMjGYKVD3oVFdD1GzoAXfqArQAsTBXMwNVlJeHVszfiUlPjXOliB p/lrT/MkDi+3PMv7FUBJR6kMaG5MN0Hlt2Xn9zkgwe53PnMKIVhmudmUW6fDqf0cdix9 SZXHKR524qvLCX7k3ueOG1rjBxkkAbQgGL8laqm52STJLtbA4wD65Y4VcXQIrLPPhR+F CKqg== 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 p90si4187587edb.343.2021.09.16.08.37.40; Thu, 16 Sep 2021 08:38:06 -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 S239456AbhIPPeT (ORCPT + 99 others); Thu, 16 Sep 2021 11:34:19 -0400 Received: from mx24.baidu.com ([111.206.215.185]:34018 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239490AbhIPPeR (ORCPT ); Thu, 16 Sep 2021 11:34:17 -0400 Received: from BC-Mail-Ex25.internal.baidu.com (unknown [172.31.51.19]) by Forcepoint Email with ESMTPS id D11931D82DDF1AADD58C; Thu, 16 Sep 2021 23:32:54 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex25.internal.baidu.com (172.31.51.19) 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:32:54 +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:54 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , Shawn Guo , Sascha Hauer , "Pengutronix Kernel Team" , Fabio Estevam , "NXP Linux Team" , , , Subject: [PATCH] Input: imx_keypad - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:32:48 +0800 Message-ID: <20210916153248.14469-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/keyboard/imx_keypad.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index ae9303848571..28d423a233f4 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -448,10 +448,9 @@ static int imx_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"); /* Init the Input device */ input_dev->name = pdev->name; -- 2.25.1