Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1496626pxb; Thu, 16 Sep 2021 08:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxafNrFpj9RFgEQCb3JsVjvgnMTA+YZQR4Lz3KJIXhCB1IxTFL4waHPFNEBNEcqNl8UWCen X-Received: by 2002:a17:906:6dcb:: with SMTP id j11mr6928981ejt.202.1631806769978; Thu, 16 Sep 2021 08:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806769; cv=none; d=google.com; s=arc-20160816; b=CyNqz5zHMdVACyE2nlh/tWNGTkDkuDB1umUHSbpXbEJk7roRr12DqUSzaqKwpu8pAP bnU2zB1kTlCve2A2A2nu9d/cH0d8NGC+Ji1YBD53n5DXh2GdBqYiqtdDZpxJu/D89zfn 9vh+aFhdq2hym0qFP7fUzcu6hurN8mVyRHngc4tnHeNDuQ1PV22GjCDiWhtcxzPFmfFj JbHnBb11+WEBxC1oJvruzVI8GJ4J47wUxfKe2jjnLNRmo+8X2ShVXsjB26T7d3zVP0v6 /gPv/PklqfPhAQaFE7mzjjEAlfyJrwIGZB4pefCDQKr9Kixo3scEvYjQi+MoS/b7FUxw aw1Q== 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=Q60LjEfqzJczUp/HLGN7AxG9noAAXp/XLNpm59nYlH0=; b=SicRZu23kkwgmM+CeEzs7JTgE6NYTgIQosp2cLRAseD3J/qIbkKCipkeLGhDtnKdTj fsqfxTyU/oXPvutU9DGLYSGNNnGLjQHPjfj2t5LJ13BV/QdYkivQqfRoPl4wgctco1O2 GGd06/r/5sZg1Tz/b56W+FiL7gYoWxszEZdzeRUXUw1gBYlH7FWQSN0bhd431QnCBn5i WIRGo5MAKDjgcJnt7gz58cP51t5v+fmz5l9RsTIll27oQefL+prEN9tK2doOt0WgGZDt O49lshSUPHhe6eK+f8fYkDqLUidgqN9SyeX1zD69lvRGWGnd0fo2mJNtPymsUv8O1x+n UylA== 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 w3si3889335ejv.301.2021.09.16.08.39.06; Thu, 16 Sep 2021 08:39:29 -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 S239557AbhIPPfe (ORCPT + 99 others); Thu, 16 Sep 2021 11:35:34 -0400 Received: from mx22.baidu.com ([220.181.50.185]:34752 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239699AbhIPPf3 (ORCPT ); Thu, 16 Sep 2021 11:35:29 -0400 Received: from BC-Mail-Ex18.internal.baidu.com (unknown [172.31.51.12]) by Forcepoint Email with ESMTPS id A6AE82D0EF1897E28CB4; Thu, 16 Sep 2021 23:33:46 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex18.internal.baidu.com (172.31.51.12) 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:45 +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:46 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , , Subject: [PATCH] Input: nspire-keypad - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:33:40 +0800 Message-ID: <20210916153341.14840-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/nspire-keypad.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c index e9fa1423f136..06c8f7c16ec7 100644 --- a/drivers/input/keyboard/nspire-keypad.c +++ b/drivers/input/keyboard/nspire-keypad.c @@ -181,10 +181,9 @@ static int nspire_keypad_probe(struct platform_device *pdev) keypad->active_low = of_property_read_bool(of_node, "active-low"); keypad->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(keypad->clk)) { - dev_err(&pdev->dev, "unable to get clock\n"); - return PTR_ERR(keypad->clk); - } + if (IS_ERR(keypad->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(keypad->clk), + "unable to get clock\n"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); keypad->reg_base = devm_ioremap_resource(&pdev->dev, res); -- 2.25.1