diff mbox

[v2,4/4] max8903: remove unnecessary malloc failed message print out.

Message ID 1465561970-18377-5-git-send-email-chris@lapa.com.au (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

chris@lapa.com.au June 10, 2016, 12:32 p.m. UTC
From: Chris Lapa <chris@lapa.com.au>

Signed-off-by: Chris Lapa <chris@lapa.com.au>
---
 drivers/power/max8903_charger.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Krzysztof Kozlowski June 10, 2016, 2:08 p.m. UTC | #1
On 06/10/2016 02:32 PM, Chris Lapa wrote:
> From: Chris Lapa <chris@lapa.com.au>

Here and in all other patches (like #1) you need to write something. The
commit title could be very short (even non-sentence) and here a little
bit longer. E.g.:

Title: power: max8903: Remove pointless 'out of memory' error message
Body: Remove the error message of memory allocation failure because it
is printed by core.

Best regards,
Krzysztof

> Signed-off-by: Chris Lapa <chris@lapa.com.au>
> ---
>  drivers/power/max8903_charger.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/max8903_charger.c b/drivers/power/max8903_charger.c
> index 20d4b55..d60f9b2 100644
> --- a/drivers/power/max8903_charger.c
> +++ b/drivers/power/max8903_charger.c
> @@ -246,10 +246,8 @@ static int max8903_probe(struct platform_device *pdev)
>  	int usb_in = 0;
>  
>  	charger = devm_kzalloc(dev, sizeof(struct max8903_data), GFP_KERNEL);
> -	if (charger == NULL) {
> -		dev_err(dev, "Cannot allocate memory.\n");
> +	if (!charger)
>  		return -ENOMEM;
> -	}
>  
>  	charger->pdata = pdev->dev.platform_data;
>  	if (IS_ENABLED(CONFIG_OF) && !charger->pdata && dev->of_node) {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/power/max8903_charger.c b/drivers/power/max8903_charger.c
index 20d4b55..d60f9b2 100644
--- a/drivers/power/max8903_charger.c
+++ b/drivers/power/max8903_charger.c
@@ -246,10 +246,8 @@  static int max8903_probe(struct platform_device *pdev)
 	int usb_in = 0;
 
 	charger = devm_kzalloc(dev, sizeof(struct max8903_data), GFP_KERNEL);
-	if (charger == NULL) {
-		dev_err(dev, "Cannot allocate memory.\n");
+	if (!charger)
 		return -ENOMEM;
-	}
 
 	charger->pdata = pdev->dev.platform_data;
 	if (IS_ENABLED(CONFIG_OF) && !charger->pdata && dev->of_node) {