Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2327241rdf; Mon, 6 Nov 2023 10:41:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbhhk8Bwlzu0nG/gENz4vHodPc+U5OY3jw9yJKuFW//A/IqfUUARS2QCs7lar4X1d47x6S X-Received: by 2002:a17:90b:164f:b0:281:858:a086 with SMTP id il15-20020a17090b164f00b002810858a086mr2978146pjb.6.1699296085915; Mon, 06 Nov 2023 10:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699296085; cv=none; d=google.com; s=arc-20160816; b=edfep+BG0n5a9t/s+A/tp9nmbNptE8/YgDWWocu1RAGyErcjMwIVKhhAey5VJBrNWg YkPyF7ePlNGVbSP4RK02CDL+AXcoRjjT0FrQAjOx7TOK1TnRE9L1f/6C4JnET9pQkKhM uJWnX/U+wN6mqGdS/oyxerJ3hLTrcQySc5XUrdZ6LEVFafdIb76eh06EiBBjrd5AvXax xrCWitd/UWBgrQSw03RN7CUu4+i+hyYBfZma+gCClubw754SNK6d11iKm7sjAPx11f25 E3/yB18MluRi7RaZYh6XL/ZJp7fIj2F5FodTphBvEmF+G9fk0NYsX5e0y6Ul7Slc4mm6 8DHQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sR18yfh6cyjYZ+WfpGoow8D5JjV9VK21wALHSBywh+o=; fh=EhYQnArFbMHj9GetyMtC39fFiEl2zsDTlAIuGjtTRaM=; b=TQwpbE3G1Mm4LNQ51+A8IgwOrMQ9kZTR206CRZROtDYFLNHB2ScbK7pHMvHpQQ1Ufi 2M/jNY8HBGq4eDJcp84gFc8shoC8wTUibtAr2i/4sePl6IvVH7sYb8YPUqI3Pt3kq3QH GoMIp3zvAz/Afkj0QepFDJNRhTxDiz48niFY0qmNr64yOQn97UHCn5z5g2yQf6Lo7BHT 6f953VexfZtHaasQH7fSKegVRvdKoPLp7X53xdxO3oe+Eo7QfrgQM3tYVDTH35bniYk3 S4v7ArlaKn2IZvAlA2jlRoupBEk6hVBvAEmEbdK3wN+IF+osNJwrID4Y7aP3ZQnurH9T 8QpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gDGfPnv4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id w88-20020a17090a6be100b002801f1333fesi8233916pjj.128.2023.11.06.10.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 10:41:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gDGfPnv4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 188C280A9B1E; Mon, 6 Nov 2023 10:41:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjKFSlD (ORCPT + 99 others); Mon, 6 Nov 2023 13:41:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232025AbjKFSlB (ORCPT ); Mon, 6 Nov 2023 13:41:01 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4815ED47 for ; Mon, 6 Nov 2023 10:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699296058; x=1730832058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yZw7GYy+N6jTZtY91G4MW52jOels4nZRd0O+FRCOOSg=; b=gDGfPnv4V5VgNcqEU71hGyUVFDp+K4pFd04cI5wo7kOEBm2vt4BhQaD5 NthsbhN40h7BFt5tG4deG6GD00ANxSZV0/hleojNVxgTOWO4lUIaDIXLQ bxOobSiKSD77aHHZ+m5Xpa2UXONlM7WLkywyA0Ggbsk0MPT4QrAx5dLI0 kFJT9v2OyufpVmhtBlG2ejw5qOBYmdqLdIPDGZnmxhpq6gldZ9w3RRBXz k/zkxViHmBWfdVThWV/5lptAwE7ygh0q+OrdAdPR3OY0WfQHEzGR5EVR+ y3VdscWHTwTxR45V3mZ+r9FXcms0Ln5tyH3mZ5XTXj6vtz8SX7g+ItZtg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="369549378" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="369549378" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 10:40:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="1009622594" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="1009622594" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 06 Nov 2023 10:40:56 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 52C4B706; Mon, 6 Nov 2023 20:40:55 +0200 (EET) From: Andy Shevchenko To: Jarkko Nikula , Andy Shevchenko , Chen Ni , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v3 2/2] mfd: intel-lpss: Amend IRQ check Date: Mon, 6 Nov 2023 20:40:52 +0200 Message-Id: <20231106184052.1166579-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231106184052.1166579-1-andriy.shevchenko@linux.intel.com> References: <20231106184052.1166579-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 10:41:19 -0800 (PST) From: Chen Ni platform_get_irq() returns a negative error code to indicating an error. All the same does pci_alloc_irq_vectors() and pci_irq_vector(). So in intel_lpss_probe() the erroneous IRQ should be better returned as is. The pci_alloc_irq_vectors() call and platform_get_irq() guarantee that IRQ won't be 0, hence drop that check. Signed-off-by: Chen Ni [andy: updated commit message] Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 9591b354072a..4c9d0222751a 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -378,9 +378,12 @@ int intel_lpss_probe(struct device *dev, struct intel_lpss *lpss; int ret; - if (!info || !info->mem || info->irq <= 0) + if (!info || !info->mem) return -EINVAL; + if (info->irq < 0) + return info->irq; + lpss = devm_kzalloc(dev, sizeof(*lpss), GFP_KERNEL); if (!lpss) return -ENOMEM; -- 2.40.0.1.gaa8946217a0b