From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757499AbdLQTaj (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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.15.1