lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Oct 2021 17:05:27 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Cai Huoqing <caihuoqing@...du.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        "Pengutronix Kernel Team" <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        "NXP Linux Team" <linux-imx@....com>,
        Vladimir Zapolskiy <vz@...ia.com>,
        "Neil Armstrong" <narmstrong@...libre.com>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Andy Gross <agross@...nel.org>,
        "Bjorn Andersson" <bjorn.andersson@...aro.org>,
        Heiko Stuebner <heiko@...ech.de>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-amlogic@...ts.infradead.org>,
        <linux-arm-msm@...r.kernel.org>,
        <linux-rockchip@...ts.infradead.org>
Subject: Re: [PATCH v4 6/9] iio: adc: meson_saradc: Make use of the helper
 function dev_err_probe()

On Fri, 8 Oct 2021 17:28:54 +0800
Cai Huoqing <caihuoqing@...du.com> 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 <caihuoqing@...du.com>
Make sure you don't miss any tags on previous versions.  This had:

Reviewed-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com> #Meson8b Odroid-C1


> v1->v2: Remove the separate line of PTR_ERR().
> 
>  drivers/iio/adc/meson_saradc.c | 39 +++++++++++++++-------------------
>  1 file changed, 17 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index 705d5e11a54b..62cc6fb0ef85 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -1230,35 +1230,31 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	priv->clkin = devm_clk_get(&pdev->dev, "clkin");
> -	if (IS_ERR(priv->clkin)) {
> -		dev_err(&pdev->dev, "failed to get clkin\n");
> -		return PTR_ERR(priv->clkin);
> -	}
> +	if (IS_ERR(priv->clkin))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(priv->clkin),
> +				     "failed to get clkin\n");
>  
>  	priv->core_clk = devm_clk_get(&pdev->dev, "core");
> -	if (IS_ERR(priv->core_clk)) {
> -		dev_err(&pdev->dev, "failed to get core clk\n");
> -		return PTR_ERR(priv->core_clk);
> -	}
> +	if (IS_ERR(priv->core_clk))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(priv->core_clk),
> +				     "failed to get core clk\n");
>  
>  	priv->adc_clk = devm_clk_get(&pdev->dev, "adc_clk");
>  	if (IS_ERR(priv->adc_clk)) {
> -		if (PTR_ERR(priv->adc_clk) == -ENOENT) {
> +		if (PTR_ERR(priv->adc_clk) == -ENOENT)
>  			priv->adc_clk = NULL;
> -		} else {
> -			dev_err(&pdev->dev, "failed to get adc clk\n");
> -			return PTR_ERR(priv->adc_clk);
> -		}
> +		else
> +			return dev_err_probe(&pdev->dev, PTR_ERR(priv->adc_clk),
> +					     "failed to get adc clk\n");
>  	}
>  
>  	priv->adc_sel_clk = devm_clk_get(&pdev->dev, "adc_sel");
>  	if (IS_ERR(priv->adc_sel_clk)) {
> -		if (PTR_ERR(priv->adc_sel_clk) == -ENOENT) {
> +		if (PTR_ERR(priv->adc_sel_clk) == -ENOENT)
>  			priv->adc_sel_clk = NULL;
> -		} else {
> -			dev_err(&pdev->dev, "failed to get adc_sel clk\n");
> -			return PTR_ERR(priv->adc_sel_clk);
> -		}
> +		else
> +			return dev_err_probe(&pdev->dev, PTR_ERR(priv->adc_sel_clk),
> +					     "failed to get adc_sel clk\n");
>  	}
>  
>  	/* on pre-GXBB SoCs the SAR ADC itself provides the ADC clock: */
> @@ -1269,10 +1265,9 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
>  	}
>  
>  	priv->vref = devm_regulator_get(&pdev->dev, "vref");
> -	if (IS_ERR(priv->vref)) {
> -		dev_err(&pdev->dev, "failed to get vref regulator\n");
> -		return PTR_ERR(priv->vref);
> -	}
> +	if (IS_ERR(priv->vref))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(priv->vref),
> +				     "failed to get vref regulator\n");
>  
>  	priv->calibscale = MILLION;
>  

Powered by blists - more mailing lists