[PATCH] siox: bus-gpio: Remove the use of dev_err_probe()

Xichao Zhao posted 1 patch 1 month, 2 weeks ago
drivers/siox/siox-bus-gpio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] siox: bus-gpio: Remove the use of dev_err_probe()
Posted by Xichao Zhao 1 month, 2 weeks ago
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/siox/siox-bus-gpio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/siox/siox-bus-gpio.c b/drivers/siox/siox-bus-gpio.c
index d6f936464063..413d5f92311c 100644
--- a/drivers/siox/siox-bus-gpio.c
+++ b/drivers/siox/siox-bus-gpio.c
@@ -93,8 +93,7 @@ static int siox_gpio_probe(struct platform_device *pdev)
 
 	smaster = devm_siox_master_alloc(dev, sizeof(*ddata));
 	if (!smaster)
-		return dev_err_probe(dev, -ENOMEM,
-				     "failed to allocate siox master\n");
+		return -ENOMEM;
 
 	platform_set_drvdata(pdev, smaster);
 	ddata = siox_master_get_devdata(smaster);
-- 
2.34.1
Re: [PATCH] siox: bus-gpio: Remove the use of dev_err_probe()
Posted by Thorsten Scherer 1 month, 1 week ago
Hello Xichao, Hello Greg,

On Tue, Aug 19, 2025 at 08:17:49PM +0800, Xichao Zhao wrote:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>

Acked-by: Thorsten Scherer <t.scherer@eckelmann.de>

@gregkh: Could you please take this patch into your tree?

Xichao, thank you for your contribution and Greg, thank you for taking
care.

Best regards
Thorsten

> ---
>  drivers/siox/siox-bus-gpio.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/siox/siox-bus-gpio.c b/drivers/siox/siox-bus-gpio.c
> index d6f936464063..413d5f92311c 100644
> --- a/drivers/siox/siox-bus-gpio.c
> +++ b/drivers/siox/siox-bus-gpio.c
> @@ -93,8 +93,7 @@ static int siox_gpio_probe(struct platform_device *pdev)
>  
>  	smaster = devm_siox_master_alloc(dev, sizeof(*ddata));
>  	if (!smaster)
> -		return dev_err_probe(dev, -ENOMEM,
> -				     "failed to allocate siox master\n");
> +		return -ENOMEM;
>  
>  	platform_set_drvdata(pdev, smaster);
>  	ddata = siox_master_get_devdata(smaster);
> -- 
> 2.34.1
>