From patchwork Sun Dec 17 19:30:24 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: 10117833 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 B8E2060327 for ; Sun, 17 Dec 2017 19:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC98528AA0 for ; Sun, 17 Dec 2017 19:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A161529102; Sun, 17 Dec 2017 19:30:52 +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=unavailable 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 60859292DF for ; Sun, 17 Dec 2017 19:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757380AbdLQTaj (ORCPT ); Sun, 17 Dec 2017 14:30:39 -0500 Received: from mout.web.de ([212.227.15.3]:59282 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbdLQTai (ORCPT ); Sun, 17 Dec 2017 14:30:38 -0500 Received: from [192.168.1.3] ([78.48.23.29]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LcUIo-1epIUg3hw6-00joz2; Sun, 17 Dec 2017 20:30:33 +0100 To: linux-pm@vger.kernel.org, Sebastian Reichel Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] jz4740-battery: Delete an error message for a failed memory allocation in jz_battery_probe() Message-ID: <54d86c99-fea3-ced3-12fa-b92b340228b0@users.sourceforge.net> Date: Sun, 17 Dec 2017 20:30:24 +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:9Tm5cw+IrxUlcAmF3hIQp8w+8yyLbq8tEoVPVlmjylOW9p2JWwD u2CFnqRKzokUqmG14SixwKxtI7Y/DwRs4oJgfYuCqgcmnSXcxzM1HmX2N5Gdim4qtFBcShR NOCIFq2uI5UhJYeTTjz6ZSJqn9dLjJzmDwRKTXjGVd83PTDm4YxkFge02vhlVTSsaK/KNUg n3qSjSIxP7FbhHJbGMfsg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7apIE9XyGpo=:9198IWaV/UKBdKl2qJ6jEV uRiDEcBTvrFPibgz1MJoSOkXLb/7OhQZ5JourI1PEx3c6p3TvZ1Ju5IQt9hMvYCXDmBkddCOk qJux5RRLHdgNlA65GMb8tuVtTDkMD0dkJtOaIyNJ9e7gputsQk3/Gxo6GAEHwYGY2o475D/9O nvoFskoX2dbYEQkMj3Nsx2FjcOG42vtbRaf0GmiVG26UNIKk4di/otTVwCC/P0838ekQEa3Gx CWmOqWHoA4Nc3NQb3XdgskzLflJT5XWKpySX0gYy2B54cFext9BKM1GtKfmtr5lncadMrSKJk ej4qH18gfhZyLUKMQptS371mo6Tvru22VR6gZkJ/HcK7i2DsudM1s6H2+lYEAjjMffOoKFRqu PFCPV8e+tBq3E4mp0bXDcw2F9KDuzeZ+fOgjeU71gGfs+lPo+XlWL0gGT9qUigObpvz8SSU7y sgMZL9CXNamI30stHWrzOIGbgT++y1tSC0TvxGCE5IMoIF9imcoVYhujwkFAgSOxsbVAnun6v ddy7WdHqV+cYv7fcuYM7nGfxgMP/TCI2Unwrbj9M1m9hijNUCnFbcbDcmW0Ad0QGJbccTKyn/ KNpToDCvXcH16eZIQhaWxP8Eqd1txHF1204uvw06r/u6bCu9mjE8/ZsgZdnCu3O3g81MrgHQ5 yqluEU/1PeU9/+M4pRvYm+Hwkl/FdBVBa8BdA4CaRsr5bj3tga2opD5q8qJ97Qp+hbsRIn1Oc dllwYBMpkRxeAbu+RDbec+oO17lHAbvFqckkzULlkbNjTxbO74Fva2ckvY2jBAsI/K9cdIOcH bJ6C1zdD13E0Nn92CtRp+wIwJWOi9VJSyNhSlU8RX1c0t3J2XQ= 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: Sun, 17 Dec 2017 20:23:28 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/power/supply/jz4740-battery.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/power/supply/jz4740-battery.c b/drivers/power/supply/jz4740-battery.c index 88f04f4d1a70..5210c9a92e2d 100644 --- a/drivers/power/supply/jz4740-battery.c +++ b/drivers/power/supply/jz4740-battery.c @@ -254,10 +254,8 @@ static int jz_battery_probe(struct platform_device *pdev) } jz_battery = devm_kzalloc(&pdev->dev, sizeof(*jz_battery), GFP_KERNEL); - if (!jz_battery) { - dev_err(&pdev->dev, "Failed to allocate driver structure\n"); + if (!jz_battery) return -ENOMEM; - } jz_battery->cell = mfd_get_cell(pdev);