diff mbox series

[PATCHv1,07/11] power: supply: generic-adc-battery: drop memory alloc error message

Message ID 20230309225041.477440-8-sre@kernel.org (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series Add DT support for generic ADC battery | expand

Commit Message

Sebastian Reichel March 9, 2023, 10:50 p.m. UTC
Error printing happens automatically for memory allocation problems.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/power/supply/generic-adc-battery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Linus Walleij March 10, 2023, 8:29 a.m. UTC | #1
On Thu, Mar 9, 2023 at 11:50 PM Sebastian Reichel <sre@kernel.org> wrote:

> Error printing happens automatically for memory allocation problems.
>
> Signed-off-by: Sebastian Reichel <sre@kernel.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Matti Vaittinen March 13, 2023, 7:50 a.m. UTC | #2
On 3/10/23 00:50, Sebastian Reichel wrote:
> Error printing happens automatically for memory allocation problems.
> 
> Signed-off-by: Sebastian Reichel <sre@kernel.org>

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

> ---
>   drivers/power/supply/generic-adc-battery.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
> index d07eeb7d46d3..771e5cfc49c3 100644
> --- a/drivers/power/supply/generic-adc-battery.c
> +++ b/drivers/power/supply/generic-adc-battery.c
> @@ -243,10 +243,8 @@ static int gab_probe(struct platform_device *pdev)
>   	bool any = false;
>   
>   	adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
> -	if (!adc_bat) {
> -		dev_err(&pdev->dev, "failed to allocate memory\n");
> +	if (!adc_bat)
>   		return -ENOMEM;
> -	}
>   
>   	psy_cfg.drv_data = adc_bat;
>   	psy_desc = &adc_bat->psy_desc;
diff mbox series

Patch

diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index d07eeb7d46d3..771e5cfc49c3 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -243,10 +243,8 @@  static int gab_probe(struct platform_device *pdev)
 	bool any = false;
 
 	adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
-	if (!adc_bat) {
-		dev_err(&pdev->dev, "failed to allocate memory\n");
+	if (!adc_bat)
 		return -ENOMEM;
-	}
 
 	psy_cfg.drv_data = adc_bat;
 	psy_desc = &adc_bat->psy_desc;