Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2018790pxb; Thu, 16 Sep 2021 23:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjpDeBX/6o59MAmJflffENrzat3SjF38w1QCxAw6y/wqcqh63Z5LtKe8NvCwWHyvRwlQWz X-Received: by 2002:a05:6402:401:: with SMTP id q1mr11022367edv.154.1631860498741; Thu, 16 Sep 2021 23:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631860498; cv=none; d=google.com; s=arc-20160816; b=LVM7bZZZVi58aIUPKqf5MKW5SX8Pml0oiJVQz4SSR8jQOXEkp6KmDn3UIhCmqR/5TJ 5jTD0lUHBXsP50iZlSRFoFtkPXgLliKLdHucMQpmTPkPdDjE09wLDPPu2dk5RfiZlDH6 WRkNAfNfi0LJu2rQ7TErSpvuXRMArbxeKKAFMmAsj0PkU3sq7OAOaePcyWQS4Yef5NlJ 6GKC7f514+QBEFxp85Vz9BFuMGhN2oF3gHoJPVgscJPGrgwIRykW4TNZ9EtMaUoA4b6z lOexoDpO9UR2mKyAorba8q6olwir/aK6Z6/JvabzkCpJehbLGmzzxQ/2aFNCxHwIdZBb ko2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=aPqXaki3kTNtzs+IBn2vwzm69PgohIB0NjsloXvM80E=; b=BW0NnKySr0Fl37pH5UrLngvTYESg+U8ipR0idYMnQJNy/CnBEYb5Dhjwd658swgTLQ KIykoC03UHsQKCUQj7L7OJNuNCKioLVnkM//Z1yONvyPBB59McGR9abIIILre5fQxZL4 yLXzrypzMhAewY9yMgHzLBi+s9wpH1tmLEqWJ4pw8HCTCO88bS8c7z7fQ9xUys7EtGmR uCu0k0dKdAcbqEFVPtcBhLakkqT8d2hKqaZQdJu8LjJFkRTjd/9fsaCHzjwRKTC0p+Su 71wxhfra6fKVl3jJJlXOcCXHRol+0/601zK1VLOPMVrIhwb14tdeNZpeyaGFpd1XDFZ8 K1ew== 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 j30si6246789ejj.467.2021.09.16.23.34.35; Thu, 16 Sep 2021 23:34:58 -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 S236946AbhIPUJ7 (ORCPT + 99 others); Thu, 16 Sep 2021 16:09:59 -0400 Received: from mleia.com ([178.79.152.223]:49050 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231994AbhIPUJ4 (ORCPT ); Thu, 16 Sep 2021 16:09:56 -0400 X-Greylist: delayed 589 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Sep 2021 16:09:55 EDT Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 830C9210E9; Thu, 16 Sep 2021 19:58:45 +0000 (UTC) Subject: Re: [PATCH] Input: lpc32xx-keys - Make use of the helper function dev_err_probe() To: Cai Huoqing Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210916153311.14628-1-caihuoqing@baidu.com> From: Vladimir Zapolskiy Message-ID: <5f832f6c-0807-9cfb-f441-6eff820c40e1@mleia.com> Date: Thu, 16 Sep 2021 22:58:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210916153311.14628-1-caihuoqing@baidu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20210916_195845_556695_4A8AB492 X-CRM114-Status: GOOD ( 17.01 ) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Cai, On 9/16/21 6:33 PM, Cai Huoqing wrote: > 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/lpc32xx-keys.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c > index 943aeeb0de79..12bdf68b8fe7 100644 > --- a/drivers/input/keyboard/lpc32xx-keys.c > +++ b/drivers/input/keyboard/lpc32xx-keys.c > @@ -227,10 +227,9 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) > > /* Get the key scanner clock */ > kscandat->clk = devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(kscandat->clk)) { > - dev_err(&pdev->dev, "failed to get clock\n"); > - return PTR_ERR(kscandat->clk); > - } > + if (IS_ERR(kscandat->clk)) > + return dev_err_probe(&pdev->dev, PTR_ERR(kscandat->clk), > + "failed to get clock\n"); > > /* Configure the key scanner */ > error = clk_prepare_enable(kscandat->clk); > thank you for the change! Acked-by: Vladimir Zapolskiy -- Best wishes, Vladimir