From patchwork Wed Nov 29 16:17:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10082725 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 5FC916020B for ; Wed, 29 Nov 2017 16:19:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B87F29B17 for ; Wed, 29 Nov 2017 16:19:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FB1729B1A; Wed, 29 Nov 2017 16:19:15 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED63429B1A for ; Wed, 29 Nov 2017 16:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rQo37LSt+X5F/jOww2079hEi+LFjm3mlHhzm3wjHZVk=; b=VyeHfNMFqe6AUzhhMk0fusuwFd wIbBX+sVj9TD+w7V8K45W7ecYXj/LgK1xjoix0fDkR9xnetgfelFTmUTqrZasP9SK53AZe26l3HPQ JEOvSL3ygL0zSjJYxx3Nc3pPjC8YRDdwasnMK8acEf+58W9AaIzIoH55JZdvLBSThRDXzcIFCyfmM SC1JGo9L2VMyqOG61RjEWybcykdRf9wiM6r9qQRb+uIDMn6iQXWdyYZ2lcysY4V6BUfnyRXkUUlUK ++jeBu+kYS6k4wLxgch7wFP3aTDLiqseoz5RtRMdrNJaQyfp4TAnypGlItEeoKb6aq4EqwBKx6fVR LUss0B1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK54s-0007ka-Gh; Wed, 29 Nov 2017 16:19:14 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK53y-0006lq-9s; Wed, 29 Nov 2017 16:18:27 +0000 Received: by mail-pf0-x241.google.com with SMTP id a90so1773423pfk.1; Wed, 29 Nov 2017 08:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=rQGc44kobb+l9GMik1PDW2k6gDNpdeW5OHR3DsmhreI=; b=okpB/lwdEwqvkpEpANKJ1w1ieHwelMKpBzqx1E/SulH7UtcNcgGZopOzLNLDOYm1TN 7bQLJLLcj8Qs3t2H4zIVjuAeoIqA9/iV1bI11xlwgWrYWMCahMkpqb8REVcJBYdFww0f RoZjh/tyAxPVSHz319WxYfQGhRO3VSdY/BfWAVSSR+uQ19wQqZIxqPnplLzCWm5IIq0/ QSBJPPzZrKoPS3PJpnBE0+8azvsi9hW4w/5YgsWjYiGD4rc6vhjmNRrdCOEgmgN78FiO s7Rfqo85qs6tQz/GAeAjgF8+G39X6RCPqFPP+LQ9PlLqdUEZXWlnndRjCQPbHB9MlHTB OcJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=rQGc44kobb+l9GMik1PDW2k6gDNpdeW5OHR3DsmhreI=; b=JocIpeLHy2tYzLg0nnsxkib3J7/BWThGWc4GJ3LHYu5b397r5dhxs3Wl5gsDB9q6Pl gRHfafJw0LKGcnw9n6JDq5HIjssr/oa/Ojw81dxpDYND86GlzU/5d5QFguwkNqr+SdDP Ga7vgr8qyZf/LJbKdAsrcp9hD23sx7MUWYxoOtOjtNdW9klPGu8MZZuBRZmODsDZxg5s b0B2OzsJDr4mfGEPx+QrCnm7cz7Q0T8knZPeL84dEs1plmJX/UmXm9VbnC8KMl4Ldzgz 4egwNoYOH/MNcaPL97LgjnsFrJyVPomftT12+HbnZeNHkNuj/pNfO5x3wgZmrjMzZkZQ FF3g== X-Gm-Message-State: AJaThX6LZQivMzCERQox0RzG8KPBQzIr107wmt3U44Ys9WvwgHuG5QFC 61SJHRfyxvJmCUNkMoHFhoA= X-Google-Smtp-Source: AGs4zMb8YI2ArXSjvfpIxwhleeWAOcD8vKtB9LzfMsG1nSbqSTRA4s7F2f2e8+xkg9C449ci42fN4Q== X-Received: by 10.98.75.210 with SMTP id d79mr3483808pfj.230.1511972277804; Wed, 29 Nov 2017 08:17:57 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:57 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Subject: [PATCH 5/5 v4] ASoC: intel: mfld: Handle return value of platform_get_irq Date: Wed, 29 Nov 2017 21:47:14 +0530 Message-Id: <3c83856bd9f1f23d1e0f5e8753d3998ae4785e37.1511970158.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_081818_839474_B1893565 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. changes in v3 : Return -ENODEV insted of irq. changes in v4 : Add separate error for irq == 0 and irq < 0. sound/soc/intel/boards/mfld_machine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c index 6f44acf..7cb44fd 100644 --- a/sound/soc/intel/boards/mfld_machine.c +++ b/sound/soc/intel/boards/mfld_machine.c @@ -372,6 +372,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev) /* retrive the irq number */ irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return irq < 0 ? irq : -ENODEV; /* audio interrupt base of SRAM location where * interrupts are stored by System FW */