From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FD5CC61D85 for ; Thu, 23 Nov 2023 11:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345008AbjKWLSU (ORCPT ); Thu, 23 Nov 2023 06:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344939AbjKWLSR (ORCPT ); Thu, 23 Nov 2023 06:18:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 575381AE for ; Thu, 23 Nov 2023 03:18:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01A37C433C7; Thu, 23 Nov 2023 11:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700738304; bh=+x/URQgVb4SiWXQmWUgGkAjGeRrBtfsrwcdrEF0IBtw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UjSMQj7nZ67/7+0ThgmDgmc3tUqTfqdRB342jny9HKMGkPLRX4vUAP879qF2AF8EN P8oc7u+xBMczUlMmm0Udx6R6SkOISrJIyd/3RByDdvuIslzDn4xQ32ydSPtpRb33YI H9KwBuRHABJm1rOGUiD3UhdUaB3Q1wyEqMb4225yoTUa3hnycji7X0Fh0WnF6RpJ2J rBrEjZ5kE4cebOntOaSXOV4hjt+mcy3054yFaLk1qBDlC8OPJCjP2/DXObkQIxChRZ ITYn+wgllCDtIWvE/Rn46DoTYOPmNaIsD9iJVJBRrxA1hLVwXnfENOi18ImS87mSFV YEMFV9wIZbN1Q== Date: Thu, 23 Nov 2023 11:18:20 +0000 From: Lee Jones To: Andy Shevchenko Cc: Jarkko Nikula , Chen Ni , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] mfd: intel-lpss: Amend IRQ check Message-ID: <20231123111820.GC1243364@google.com> References: <20231106184052.1166579-1-andriy.shevchenko@linux.intel.com> <20231106184052.1166579-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231106184052.1166579-3-andriy.shevchenko@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 06 Nov 2023, Andy Shevchenko wrote: > 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] I reworded it further. > 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 > -- Lee Jones [李琼斯]