From patchwork Tue Aug 29 19:09:16 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: 9927969 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 36D6E6022E for ; Tue, 29 Aug 2017 19:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26DA728A25 for ; Tue, 29 Aug 2017 19:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B97F28A2C; Tue, 29 Aug 2017 19:09:26 +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 BCC3328A25 for ; Tue, 29 Aug 2017 19:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbdH2TJY (ORCPT ); Tue, 29 Aug 2017 15:09:24 -0400 Received: from mout.web.de ([212.227.15.3]:59873 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdH2TJX (ORCPT ); Tue, 29 Aug 2017 15:09:23 -0400 Received: from [192.168.1.2] ([77.181.80.150]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LfEfA-1dBAwu3IEa-00oqdL; Tue, 29 Aug 2017 21:09:16 +0200 To: linux-media@vger.kernel.org, James Hogan , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] [media] img-ir: Delete an error message for a failed memory allocation in img_ir_probe() Message-ID: <74e8f4f2-9086-2edb-c64b-e88918b9f742@users.sourceforge.net> Date: Tue, 29 Aug 2017 21:09:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:JUZHg5fJNQCf/SPjog+prMUX2laNQirXbtbswz1uqMgXAAJqe/M Iv1zLKnU9djBmqU8JL7u7UKBIt786y3UmEsop+umYZToCPaSnoJs18bV/exvfQl9xE/A4OJ m8RmP9xcs00qK93FVw/mrBL30BcZAMJV2MsHHkJuPF9SazMwV74b8RWbyctKAt4uOBUYB3g dhT529WWZVH9dDesKikjg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ory72U2nVN4=:HMZ83VammKtXjn8ThHR1/1 ILshN9jA9JSOOAYbC8WA+NDOJShlrzYPyZyqjodke8wDKYcMDbQa3U/lxRt/CatHlfzZy84qG LYOSSL6WeRp653D6JZ+Nr349sjhBnhXDNou9BqPYW2LaOfGjqUGTOnJDlV2fsUobOxu/aHDhY xzaAzS9husm4/HsQReffryO+7tzx8OHn3MAVw5nDyQmxwWm0cKKsFjnU38R/qhN4fowmCE7G3 GDjNJUvqfVuehlrDvJ1xssKsBxoDZUwy1vUlNRE7Tz0NjNj+91qehoRFd7voBASVid1H1O8me u2pSfcph6mHTiirNm0XIzYk71n4QzUX8cuy+MFAFIdDwkiU2j36bBXTRDyrq2alZnd/DWUMkz f/6gHwxwjLp+5u5bZHyEyXzPd/8aiknrohYJ/W/CdBNElSrrDfMrDsTdFGaWSMaBIKM9Kixer BVonQ6EOfr0Aw2aJ0dJny0cXmm06tu34YK31QK09mGdocfBdYvK0vBjkY3zaFaDvyRTNzGl1U IquSBG+V+4X1SCRY8A5zWEtSzjOEPFandZKQY/CNw3tcLtui+zrk5IadHI1W2533C0Pn4agvF tRxALuEEHDuKKatQJSny/bSrgtqCHJ4+0pIIIOWlZ6WoOcSnkopzAgxePeCawlRKmFbySybCT WMuuSu3iX1OzHjZGQwip29sygInqLnW2DzabRfKIkwgFCjrVZ9LJv/FtXgkB7BGlJScZ5ypPd j5sxgavUDUzhGGskd5yEQ1U9Wj5Bu9ozJrqEv7NVIq7LFOK8siJpU3CRcFs4K2RcFXmh5riYC TltR9K4nUI5wQyf3+yDgCbf36cIg9cEUY8T15cvYgQbQ5ACA1s= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 29 Aug 2017 21:04:20 +0200 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/media/rc/img-ir/img-ir-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/img-ir/img-ir-core.c b/drivers/media/rc/img-ir/img-ir-core.c index 03fe080278df..bcbabeeab12a 100644 --- a/drivers/media/rc/img-ir/img-ir-core.c +++ b/drivers/media/rc/img-ir/img-ir-core.c @@ -92,10 +92,9 @@ static int img_ir_probe(struct platform_device *pdev) /* Private driver data */ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(&pdev->dev, "cannot allocate device data\n"); + if (!priv) return -ENOMEM; - } + platform_set_drvdata(pdev, priv); priv->dev = &pdev->dev; spin_lock_init(&priv->lock);