Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1342074pxb; Wed, 2 Feb 2022 02:47:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVP3W5zrjNsq6On2kHCl167R1ioQgva0T+CF76+u8xZLL9oKZx5BvIlTgbm7j2PaZ2kxLr X-Received: by 2002:a17:90a:e7d0:: with SMTP id kb16mr7463382pjb.128.1643798820258; Wed, 02 Feb 2022 02:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643798820; cv=none; d=google.com; s=arc-20160816; b=Ov543mCIYxjBohl96gaDHvKfXKH9LNieSulFjsl6J37CpCkreVPk5i1vec2p77vK7u vsDR0+pzSQpiaOP6AoCtgqAnI3hMP5Y9s5zxQ7DmxhYlsAV1TrN6/T+gS2VlZSztj7KR f902By0EcYpvk8X1bT69CSuGsGefeUiXV7mpGwKgA4bxQvVWgYgquZGrv8B9qmoJvxDE bzyBQ65QvhqOSh02bdItQlpCvfeFLsM1oFXXNoQfxjQSnjf9Z+4jifi80VRwuUj8oKRc BMIrnvayB5Iu9M5L5J20WKWFHhCbe56iqRsN3/YoDTjpcRUliZowyOFUupAJD0UDuwWd /vPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=a+uTZSHAxuLPJguLc6EBQbkbbrN7NBNQaK3BpBuFcKU=; b=UOEuYlc4ACkDJZDKXymIK4HPlHzougzdoUKwN30vpJ5LB2xXEQbedtka1BgFWT/APV Gdrr469CIYADTesnbtN2vmKnZpWWHL4EuYc5c6TzHRRz0cDdahCiRkoja92c/bKke96N KVFDQvgcJxMSn6N9f4mal5f226VZlRm7wqq6B1wokkGhiNe/xQRWsBuoHSwNCHFCo71n uPDbEby571+H4c93MLpysgeL85JPUjHhuEZFS4xosYPbbeOzWpUHwMVY/MBk/uxsB3bU 6/iF+zclBY+27CIUcR161LxFScNV5LekxRGjAFL0RSv7eEgm9QBJyT172y7HGujGsiey eXcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17si4918693pjg.138.2022.02.02.02.46.48; Wed, 02 Feb 2022 02:47:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243858AbiBBCz3 (ORCPT + 99 others); Tue, 1 Feb 2022 21:55:29 -0500 Received: from smtp25.cstnet.cn ([159.226.251.25]:38602 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232917AbiBBCz2 (ORCPT ); Tue, 1 Feb 2022 21:55:28 -0500 Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-05 (Coremail) with SMTP id zQCowAAH9kCM8vlhBN1HAA--.26718S2; Wed, 02 Feb 2022 10:55:08 +0800 (CST) From: Jiasheng Jiang To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH v2] mfd: intel-lpss: Check for error irq Date: Wed, 2 Feb 2022 10:55:06 +0800 Message-Id: <20220202025506.494801-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAAH9kCM8vlhBN1HAA--.26718S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw1DAryDAFy3Wr18Jw47Arb_yoW8Gr43pF srKF9rurn5Wa18uayUCwn8ZFW5ua10k3y8Gr4akry3Z3W5Jr13AFW5XFWIvrsrCFZ3twsx tr45trW8uF4UZa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr 1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_ Gr1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUbYhF7UUUU U== X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") Signed-off-by: Jiasheng Jiang Acked-for-MFD-by: Lee Jones --- Changelog: v1 -> v2 * Change 1. Rebase the patch against the latest code. --- drivers/mfd/intel-lpss-acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index f2ea6540a01e..8b1e1046a065 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -148,7 +148,11 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) return -ENOMEM; info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - info->irq = platform_get_irq(pdev, 0); + ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; + + info->irq = ret; ret = intel_lpss_probe(&pdev->dev, info); if (ret) -- 2.25.1