diff mbox

[1/6] power: supply: gpio-charger: Remove redundant dev_err call in probe function

Message ID 20180305180414.GB5533@lenoch (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ladislav Michl March 5, 2018, 6:04 p.m. UTC
There is an error message within devm_kzalloc already.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 drivers/power/supply/gpio-charger.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sebastian Reichel March 9, 2018, 4 p.m. UTC | #1
Hi,

On Mon, Mar 05, 2018 at 07:04:14PM +0100, Ladislav Michl wrote:
> There is an error message within devm_kzalloc already.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/gpio-charger.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
> index f0d8cc19ad1e..78b55566e215 100644
> --- a/drivers/power/supply/gpio-charger.c
> +++ b/drivers/power/supply/gpio-charger.c
> @@ -137,10 +137,8 @@ static int gpio_charger_probe(struct platform_device *pdev)
>  	}
>  
>  	gpio_charger = devm_kzalloc(dev, sizeof(*gpio_charger), GFP_KERNEL);
> -	if (!gpio_charger) {
> -		dev_err(dev, "Failed to alloc driver structure\n");
> +	if (!gpio_charger)
>  		return -ENOMEM;
> -	}
>  
>  	/*
>  	 * This will fetch a GPIO descriptor from device tree, ACPI or
> -- 
> 2.16.2
>
diff mbox

Patch

diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
index f0d8cc19ad1e..78b55566e215 100644
--- a/drivers/power/supply/gpio-charger.c
+++ b/drivers/power/supply/gpio-charger.c
@@ -137,10 +137,8 @@  static int gpio_charger_probe(struct platform_device *pdev)
 	}
 
 	gpio_charger = devm_kzalloc(dev, sizeof(*gpio_charger), GFP_KERNEL);
-	if (!gpio_charger) {
-		dev_err(dev, "Failed to alloc driver structure\n");
+	if (!gpio_charger)
 		return -ENOMEM;
-	}
 
 	/*
 	 * This will fetch a GPIO descriptor from device tree, ACPI or