From patchwork Sat Dec 16 18:43:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10117373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F08660327 for ; Sat, 16 Dec 2017 18:43:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 023252933D for ; Sat, 16 Dec 2017 18:43:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8C3C294C3; Sat, 16 Dec 2017 18:43:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89ADC2933D for ; Sat, 16 Dec 2017 18:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756694AbdLPSnQ (ORCPT ); Sat, 16 Dec 2017 13:43:16 -0500 Received: from mout.web.de ([212.227.15.14]:53336 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577AbdLPSnP (ORCPT ); Sat, 16 Dec 2017 13:43:15 -0500 Received: from [192.168.1.3] ([77.181.206.168]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LnVr4-1ewsgC1wNi-00hbuO; Sat, 16 Dec 2017 19:43:10 +0100 To: linux-pm@vger.kernel.org, Sebastian Reichel Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two functions Message-ID: Date: Sat, 16 Dec 2017 19:43:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:moZ+4ayn+G37AjlsXoCwzsb5Pz6TljrxpAWKJb8Qgw2sV4TYzBJ pe4pg7OSj/N9onU+kcn1Zi/MKM+1p36StrXTzuBFt088bJJ4Hh8wolFni/t7aGqLryEhp99 xZ9suUsEQ31xMdfOrl9XllmdZ5CW1+iCw58t5oIGjn6bLX2Nrrj9y9pBVy+T6DusBlbexvP fhkwQL5gCRjrwvusMGLig== X-UI-Out-Filterresults: notjunk:1; V01:K0:CC71Boosapc=:u64rdv5I5uNho8MB/OWdKB fA3z7H4BIjzPwp49C+dIRkfIKYVPi1xUsiFZKtJqFCm/BLW+o1OTVlvSsNUuyEs4UZ7Zqu2iE xbVAD6lLiyuVXLhx7VdJW6FSHUCoPVOjVk5v7OK2bDHC7R7Rx7W6+2K5b/08Aico1hr9MOdNr ImWCVb0uIhA45N5AwPEzV7A5UbjBUNGueIACVcbiq68JAKGHL4shyPzlPy0P1UqRS+5pnhyRz xBowaPZ2iMl/3+PaBr6q1G0YpQax4AGIFoQGvKSZTKt7dx+v7b34CtFpSKGctGzMVPet4qMU/ dr6rDLjhKpF7OTC267LBe3L+/kynJT5NHy8HtbZy/oQ4ZT2FIdo3qjC5YZocrNpmQSx2z6z0E GO/zRAjtk9w15mOA5QwOyIyUxnpozSOdcd29JcJcAIyJyU1ETv70ghKtjxtBJpagMoYJXgy6S gXlen55W9DYfIhBtyMZSLy9Ey46hqIbRg0EPbibfXWm4p+mtUChT9NiALPAaRewsLnfXCgQCL MMUdnFxCvKCqGYhh5EuQadWfxm3/pEQVr5vUOX0PeqbmtmIfVVnQ1inZJfwoc/3u0zF4oZ5AM dYJx8EoxhXDqrNwrAAi4JFiQE5h9eTqkwaPOV5i3X1ZSoIvF6TwDkr6vDcl4UHEo3RLrBNheo 9VKdigNNUnoAXXnTdTl26pvbfm9i3CkTx8iWW0QOxM4ITGQ2PlpyG6bmAK7Zdl2UzbSAAvb4M +9w8h65DDjoq98PYnhMzCAGsTh2HaCOMuwbXnKFkV76xvxxeBkU19X/chqXs/B8All2afHfUI bptt3D+AvJfOim0Rqh3c6qK/S1VSgKy/p92w8vE0m92iE4/GVE= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 16 Dec 2017 19:32:02 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/power/supply/tps65090-charger.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c index 1b4b5e09538e..43c44d2eaeca 100644 --- a/drivers/power/supply/tps65090-charger.c +++ b/drivers/power/supply/tps65090-charger.c @@ -202,10 +202,8 @@ static struct tps65090_platform_data * unsigned int prop; pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - dev_err(&pdev->dev, "Memory alloc for tps65090_pdata failed\n"); + if (!pdata) return NULL; - } prop = of_property_read_bool(np, "ti,enable-low-current-chrg"); pdata->enable_low_current_chrg = prop; @@ -257,10 +255,8 @@ static int tps65090_charger_probe(struct platform_device *pdev) } cdata = devm_kzalloc(&pdev->dev, sizeof(*cdata), GFP_KERNEL); - if (!cdata) { - dev_err(&pdev->dev, "failed to allocate memory status\n"); + if (!cdata) return -ENOMEM; - } platform_set_drvdata(pdev, cdata);