From patchwork Fri May 26 06:35:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256480 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B4EC2100 for ; Fri, 26 May 2023 06:35:47 +0000 (UTC) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A5C12E; Thu, 25 May 2023 23:35:44 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f4b256a0c9so330023e87.2; Thu, 25 May 2023 23:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685082943; x=1687674943; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cAIWAVxuFetjJrrCyLkzZqPv0PDDDlU03pSzLI8bStI=; b=KxLR7HhkToIa5w9ZUoeLebvrRtTscYrXQvjH51a6aqQQIv/U4/P/ll2ivg3KNhai0X se9u67YaW86IKQJnDnLFmqGwaErx/BTEjJdo88RyFnFrws85sWUGzqqG0lm5eBFSrULu PZEHZOYKQu4dPje9vjVBNo+aR8lbnwt2U71aH/rFRctXC3u0zt4JEaE9+wVoHCfzhc3R zFC/dAeGjOHnGLibwG86PXjg3zNRphwdezIN4fe/OZ0hQE3pByDjoVEGsKl4DgysA3Z4 tPoXiylXe5c9da0pAGLohe3ay/eOY9nMk+0mOqDoApeHeHqJ0eiJfhuI5dydZkTHCMqO aQAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685082943; x=1687674943; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cAIWAVxuFetjJrrCyLkzZqPv0PDDDlU03pSzLI8bStI=; b=hyMTh8sKnRICOqOQSk8Kpwqwtng9/OfkhwyekkExD7et646IXveReRwzXUqBbHx4Ox OCTABG03Rvm9ZzNcja7OSdB3lsNbToM5nYiRtITHIE2ObXtEC8I8WPqHhebGpflN1Qp5 2Sa1HxGQwC0iU5Qz2tnlQiuHL3tp8LBdMmAGQpzT915xnnxCas7bh4Xyr2XGxrVgFinJ i8gRv+1ldOQ7eS4gx5mRUJen7WdpmB/giGuGbRWMtbfJkYeg+fNuQyNozEvWqTiBEJkp BP8gsL58r66UNwat2gFPdF+f47Ap15gogsgcgGtz0HAGqpoYOjjj8axW1QR8Q6MXawGU FBwQ== X-Gm-Message-State: AC+VfDzYPz176MrwutALXBHpAVQoKW01P1nqIi1KGjWaEYswhHbfplRb DcAAmiaF73zt+t8c4nBV0/4= X-Google-Smtp-Source: ACHHUZ6HZepBt7ammknEbdGsV8Qlb/uNlO/ttwYaQ9PJi60bot/xBl45aYSe7ERRZ/kwxZvicu9soQ== X-Received: by 2002:ac2:46e5:0:b0:4f3:8143:765 with SMTP id q5-20020ac246e5000000b004f381430765mr240488lfo.27.1685082942778; Thu, 25 May 2023 23:35:42 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id w17-20020ac254b1000000b004f4b2aa6f66sm487671lfk.295.2023.05.25.23.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:35:42 -0700 (PDT) Date: Fri, 26 May 2023 09:35:30 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 1/8] drivers: fwnode: fix fwnode_irq_get[_byname]() Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net The fwnode_irq_get() and the fwnode_irq_get_byname() return 0 upon device-tree IRQ mapping failure. This is contradicting the fwnode_irq_get_byname() function documentation and can potentially be a source of errors like: int probe(...) { ... irq = fwnode_irq_get_byname(); if (irq <= 0) return irq; ... } Here we do correctly check the return value from fwnode_irq_get_byname() but the driver probe will now return success. (There was already one such user in-tree). Change the fwnode_irq_get_byname() to work as documented and make also the fwnode_irq_get() follow same common convention returning a negative errno upon failure. Fixes: ca0acb511c21 ("device property: Add fwnode_irq_get_byname") Suggested-by: Sakari Ailus Suggested-by: Jonathan Cameron Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Reviewed-by: Jonathan Cameron --- I dropped the existing reviewed-by tags because change to fwnode_irq_get() was added. Revision history: v4 =>: - No Changes v3 => v4: - Change also the fwnode_irq_get() --- drivers/base/property.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index f6117ec9805c..8c40abed7852 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -987,12 +987,18 @@ EXPORT_SYMBOL(fwnode_iomap); * @fwnode: Pointer to the firmware node * @index: Zero-based index of the IRQ * - * Return: Linux IRQ number on success. Other values are determined - * according to acpi_irq_get() or of_irq_get() operation. + * Return: Linux IRQ number on success. Negative errno on failure. */ int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index) { - return fwnode_call_int_op(fwnode, irq_get, index); + int ret; + + ret = fwnode_call_int_op(fwnode, irq_get, index); + /* We treat mapping errors as invalid case */ + if (ret == 0) + return -EINVAL; + + return ret; } EXPORT_SYMBOL(fwnode_irq_get); From patchwork Fri May 26 06:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256481 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 494832100 for ; Fri, 26 May 2023 06:36:32 +0000 (UTC) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 466DF12E; Thu, 25 May 2023 23:36:29 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4eed764a10cso346745e87.0; Thu, 25 May 2023 23:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685082987; x=1687674987; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ibHKBwm98vUEtm+6oAfn7y9WF5igvmXGkvEzcD82yTg=; b=QFcrXmc1tI3PjA4ZyAn7pd37Ak2J3/PkBeGJ+U+ma2YDn79vzGar15Lb3UbTMSxX1s aCBXbzPS36K0IEeIQnz/j9SFAbivJHwCXdPpmB0WBmgl3JlwkVXPFPtzmDaY4FFM3LqU DxpNQEOwP8Gvg8zfdIRaB0tJd8YuCh+9Vhe7dsRGk8S2/Hg9szZuyY6EYH/1HYC8eiZV xlT1HcHnilEVAdxRSrazc7jlvPF8IuRraZbxvx11DZDH6kUUfNd00zNMCTPpD6fZXBXM cW3p1Eym2cSRuCVmXQ+pFdaaYCjQhbvWeB+vsGMYTtjM60b672wAHE6DVcZtyE6JGrgg yyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685082987; x=1687674987; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ibHKBwm98vUEtm+6oAfn7y9WF5igvmXGkvEzcD82yTg=; b=X9mD5KVcCGKBMOqdOXIbFdqBGF2Q7VFRihzRElfRcf+WOrEAIEdX2QTO60bHm+oFqD 8X4dJVW2Vo8erSP/SVScG9Sbwztc4HK7NP45kD4u5LZIYCi9l6HO2r3LUY+4DQl1tkxV 0NZkRYZGylOVJSEa1E60PTv+xSxsV+okidPOHOkLYGvqvSplJS0/LY1hYsVlZO4dugHe kHRZoTb0R6j97f0LMO5YPplIMpFZZqrIo7zC8Vjg35QcihMr3T1OaqcvhLbB6PaGHrzj if9pZc5wAEjWRVhpONJ785EIoFj4qgqjTNIwEwdBE9NMpYpAiGIVdCSQ03osKsWJCLd6 lQtQ== X-Gm-Message-State: AC+VfDztmhyRI6ggLxiV7I7rDrTY/ApaPV6l5oe1uT11NQwTBjAaLErY +63iEv3NL0EVwxePmXOSF1o= X-Google-Smtp-Source: ACHHUZ6O+oj6UcceXRsZij+c0/OW154pLRpmpDX3QwmlOmJe/QhpMwKwIZUsm1H4wbSJBdNi05DZ4w== X-Received: by 2002:ac2:54b2:0:b0:4f2:6817:2379 with SMTP id w18-20020ac254b2000000b004f268172379mr192487lfk.23.1685082987373; Thu, 25 May 2023 23:36:27 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id u22-20020ac243d6000000b004edc7f6ee44sm480279lfl.234.2023.05.25.23.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:36:26 -0700 (PDT) Date: Fri, 26 May 2023 09:36:15 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 2/8] iio: mb1232: relax return value check for IRQ get Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net fwnode_irq_get() was changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen Acked-by: Jonathan Cameron Reviewed-by: Andy Shevchenko --- Revsion history: v5 =>: - No changes v4 => v5: - drop unnecessary data->irqnr = -1 assignment The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/iio/proximity/mb1232.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c index e70cac8240af..3ae226297a00 100644 --- a/drivers/iio/proximity/mb1232.c +++ b/drivers/iio/proximity/mb1232.c @@ -76,7 +76,7 @@ static s16 mb1232_read_distance(struct mb1232_data *data) goto error_unlock; } - if (data->irqnr >= 0) { + if (data->irqnr > 0) { /* it cannot take more than 100 ms */ ret = wait_for_completion_killable_timeout(&data->ranging, HZ/10); @@ -212,10 +212,7 @@ static int mb1232_probe(struct i2c_client *client) init_completion(&data->ranging); data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0); - if (data->irqnr <= 0) { - /* usage of interrupt is optional */ - data->irqnr = -1; - } else { + if (data->irqnr > 0) { ret = devm_request_irq(dev, data->irqnr, mb1232_handle_irq, IRQF_TRIGGER_FALLING, id->name, indio_dev); if (ret < 0) { From patchwork Fri May 26 06:36:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256482 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 122843FFB for ; Fri, 26 May 2023 06:37:16 +0000 (UTC) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A606D125; Thu, 25 May 2023 23:37:14 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2af177f12d1so3929931fa.0; Thu, 25 May 2023 23:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083033; x=1687675033; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nTHyx8ul0jeYvSGVcy/ig3hWeMVLe8/m2Xy5fo29+U4=; b=q3SYsF3JaBt51X/Hhcb3nNtQDRFZCI3Ml+CK3KMqC6/scLDfG0QtiFCnjmmep9zzqw cNk+nEmE8FQwm3mMAwOr2/Yxjh5A/HPK5dWDA8tSTlNON/MlMNDjLkJDFimJnmSXwuiK UOj/QzuNQ10zVJ/wNuZkuu679wLeO7OW87jRLMRS4UBKcTzd7iZm207k8ybqy+VsXiVw Jzrv3P+jOcmAWUGeqmr6c7Va3G7A70Jj7b3wH/3cxknmcYf3LJ73uNUo3V/SNLr3W0kM KJZ+2wG7iYyC2+H++h97wgt+Gtkz3ZeWgmpsKPRT1yOg/x6mV+n+g7ttjYVUsOInfzPf uiKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083033; x=1687675033; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nTHyx8ul0jeYvSGVcy/ig3hWeMVLe8/m2Xy5fo29+U4=; b=O7Bl6WldQCMaQ9g9kYh2b8Mlj/y/oHm5Dx1vf728dVehPskCi6256q0kuX5kYEWMrJ vPL7ewS66RO5Lv2JUFHtfrA01ZXHwCFgTG3RR/NJp6Eu/0XbyxMEU1FCdRU+Bvn0GewA vo8ucatAvlQUo/my7QFKMhycTVHrbj1I2oBxz/I4t5NHO7qLZ7ycHXU67FsFQAlRKhKa aRe+lUw4L5i0Ky0Vz0G7EK+HyvW3EGzq2GxfG0t2lyO+A96h9fzlr5EBg4Z0OuJBXUog 6EqBLorpeA4GNxMa6/vtx9o0vjCUKHssvq8rf5GcV42hUHIoHGNjwc83++ldbbMjAr+F 8j5w== X-Gm-Message-State: AC+VfDzVqidvVTMbaFhW6XJrWDSAlTRigqO2GuG3eDneUqzRJwZatgxC 3914mh0nxksG24cX+/0AGCc= X-Google-Smtp-Source: ACHHUZ4X9pgC0XVmR+d+Ksrb8LTh0cKOkPQu76crhybPdfb5o9R68exID8yXSG4urcQPdyWB19IhCw== X-Received: by 2002:a2e:87d6:0:b0:2af:22a0:81f6 with SMTP id v22-20020a2e87d6000000b002af22a081f6mr247122ljj.34.1685083032639; Thu, 25 May 2023 23:37:12 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id s9-20020a19ad49000000b004edc55d3900sm499848lfd.0.2023.05.25.23.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:37:11 -0700 (PDT) Date: Fri, 26 May 2023 09:36:57 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 3/8] net-next: mvpp2: relax return value check for IRQ get Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org fwnode_irq_get[_byname]() were changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen --- Revision history: v5 =>: - No changes v4 = v5: Fix the subject, mb1232 => mvpp2 The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index adc953611913..5b987af306a5 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -5833,7 +5833,7 @@ static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port, v->irq = of_irq_get_byname(port_node, irqname); else v->irq = fwnode_irq_get(port->fwnode, i); - if (v->irq <= 0) { + if (v->irq < 0) { ret = -EINVAL; goto err; } @@ -6764,7 +6764,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, err = -EPROBE_DEFER; goto err_deinit_qvecs; } - if (port->port_irq <= 0) + if (port->port_irq < 0) /* the link irq is optional */ port->port_irq = 0; From patchwork Fri May 26 06:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256483 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2E102100 for ; Fri, 26 May 2023 06:38:21 +0000 (UTC) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3430D12E; Thu, 25 May 2023 23:38:20 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2af318fa2b8so3735701fa.0; Thu, 25 May 2023 23:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083098; x=1687675098; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mILjjqW3e0J19x6hS+N8rbpkhGpdI9PUFEHSMRI8loY=; b=QqXMhxrLSOQ7nywZmaV7FI8ymMNakypk/Dj49sU/2sDG0/483oULyJT6EobYi7rVba 8z9sE1Pprf0DjsFyPhYBCeJ5hj2PEc1OjxdGBMdpH3pb86B9hxgJTGVDp2nPZD7SOxsj mhmPeXbd3LP5fqRLmSSLu5MbCZbUVbq81BHynri16/t8nwtTH06TyXpz5z30VuH5vizN 27bRI/gVnmIY8LM6JfAiuCvsJl57gdSWfiwwHb4W+qXG1vKqPI9oFS56Ta+NPvU501Wr y9Sux0yIWvW9kkenQIowZeI7gvmimXrzszuOvcahFTAA6lpvw0YLtKKCP+dRbq4cXkdA pE5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083098; x=1687675098; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mILjjqW3e0J19x6hS+N8rbpkhGpdI9PUFEHSMRI8loY=; b=P39P+AdThQjdw3yHzg9grSz8usuTVt6o6+3gIsBDSYH9iVV1L83gZdFMkeq3MrkxlW VBs+ZTuWay+VH3aXtobjpQzZT3q8t5GvRQfdnedANF54h/ydPDZA2/ZP5UUngEXDe3nz /7lxjVSt/lwB1TS51dCpH7G86jhwZ38BGg/nmQoHJ46FoctkratwGsQEhgKtfU5MaXhO /pdR09S/gJ9SnvbjFNeCBeMMP3bMU/hhUmTPk4cSHxWYKgSxc+mcQmxxJ71gqFeN/OFd sUwr0RTtQdWPV8F1KcrcCDI2EjsQuT09WWR4rQiQhMUhcLEoYZzBPcBFF3yWxGt2Pdoz K+lg== X-Gm-Message-State: AC+VfDz2C/Q/jiQNYSONyQ58c/qxaIi5MXnxFJPWW2eId8EAhcYqHIi8 IfJDKscwyjQGaeMQdj+SPNs= X-Google-Smtp-Source: ACHHUZ6Gc496SV+lTjAWiPVY8wzrusV4Eabc166ebvaSq0fDx5nusWGt7ItFbzXWNBcCDtsqQ7WOfg== X-Received: by 2002:a2e:9ed9:0:b0:2ad:d949:dd39 with SMTP id h25-20020a2e9ed9000000b002add949dd39mr516174ljk.29.1685083098283; Thu, 25 May 2023 23:38:18 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id q16-20020a2e84d0000000b002ad1ba6ee36sm557453ljh.140.2023.05.25.23.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:38:17 -0700 (PDT) Date: Fri, 26 May 2023 09:38:05 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 4/8] pinctrl: wpcm450: relax return value check for IRQ get Message-ID: <830e6e61cf51d43cb7a99b846ab4676823e4e78a.1685082026.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net fwnode_irq_get[_byname]() were changed to not return 0 anymore. The special error case where device-tree based IRQ mapping fails can't no longer be reliably detected from this return value. This yields a functional change in the driver where the mapping failure is treated as an error. The mapping failure can occur for example when the device-tree IRQ information translation call-back(s) (xlate) fail, IRQ domain is not found, IRQ type conflicts, etc. In most cases this indicates an error in the device-tree and special handling is not really required. One more thing to note is that ACPI APIs do not return zero for any failures so this special handling did only apply on device-tree based systems. Drop the special (no error, just skip the IRQ) handling for DT mapping failures as these can no longer be separated from other errors at driver side. Signed-off-by: Matti Vaittinen Reviewed-by: Jonathan Neuschäfer Acked-by: Linus Walleij Reviewed-by: Jonathan Cameron --- Revision history: v5 => : - No changes v4 => v5: Fix typo in subject "elax" => "relax" Please note, I took Linus' reply to v4 cover-letter as ack && added the tag. Please let me know if this was not Ok. The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c index 2d1c1652cfd9..f9326210b5eb 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c @@ -1106,8 +1106,6 @@ static int wpcm450_gpio_register(struct platform_device *pdev, irq = fwnode_irq_get(child, i); if (irq < 0) break; - if (!irq) - continue; girq->parents[i] = irq; girq->num_parents++; From patchwork Fri May 26 06:38:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256484 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 716B73C00 for ; Fri, 26 May 2023 06:38:51 +0000 (UTC) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED5F31B3; Thu, 25 May 2023 23:38:45 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f380cd1019so350480e87.1; Thu, 25 May 2023 23:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083124; x=1687675124; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fnb9dxQpabXcqKFtwXirNw4zge4/PVN/rpFJ7Cz83LM=; b=LpwqhHvGK5SSL6RTCR97kfc10ze/o9Lp0eR/armCRpwC617whkVt6uHhF7PgghMYcy 0lhZtU5P0joOmyI/SZgmyKYFhVUOdM1EkEBn/TMuS9byx9JJoQzNoph+LieI5/CJtVMY D8e4n6D79v6TpC/NRc4CswPdqexkUSeiu8WgGfLmEgezX1s/01sJ8GO1G2WKjK8jfXfA LdeF0nD6U746okKqTlF0DeQ9wMeVkaJdSg89JEBz3r4YrvCnOl3lzEOjTmrzm3hl7CTE 139VB0WpuF5OR/MYna20UhJTqwRUY1i9QZmkMP8nqUnr0TY/U4SLqRpD/cXfzjJK2uHl CgSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083124; x=1687675124; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fnb9dxQpabXcqKFtwXirNw4zge4/PVN/rpFJ7Cz83LM=; b=UjfBUg+e40XnTAB+0I6U3GhFFxK1bEKShEu7lQG9UVYqZz6EUZCpnJwPBKFs6fTENn XRZgy6HLSlQATsmjx3Ud6daGkcIB3bCt3Y8/kK0ONF/zQqRwhEDcEOqDaL2/OEpfSDrj 4JunbjJ/KvjYm49AjSXlQv2WJa5utOKh6ViRml87lvyF/yPN+biV1Bi3Nj/ks2xHguiM JafCPAJT8u8Uw97shL/bhNV7tEQpK7hin8cijB/MkX8MpH2eZ3T5SZrj3MYFZqEkFjmf hPKP2NNntUZ9Kwe28/OUtg/uNyFXsjv0KjxbLm+5i0yMHy6h/iQYZYZr2bfkJAcngerU DSqQ== X-Gm-Message-State: AC+VfDyyPPqWlq5cPhbxIUi46Yxgi2Lnto4rDVrx2hdl9KHfrzR0+tLk YqtRDaQB3+52CM05fD5rZYs= X-Google-Smtp-Source: ACHHUZ5ImTEa7PavhV91maK0eLFhL+AAsBWGbqmK/QJoUj0CaHVhJETZEcyMg3v8zsbdo+Gbw3HjUg== X-Received: by 2002:a05:6512:49e:b0:4f4:cacb:4b4b with SMTP id v30-20020a056512049e00b004f4cacb4b4bmr204448lfq.18.1685083123710; Thu, 25 May 2023 23:38:43 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id c18-20020a197612000000b004f122a378d4sm483847lff.163.2023.05.25.23.38.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:38:43 -0700 (PDT) Date: Fri, 26 May 2023 09:38:39 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 5/8] pinctrl: ingenic: relax return value check for IRQ get Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net fwnode_irq_get[_byname]() were changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen Reviewed-by: Paul Cercueil Acked-by: Linus Walleij Reviewed-by: Jonathan Cameron --- Revision history: - No changes Please note, I took Linus' reply to v4 cover-letter as ack && added the tag. Please let me know if this was not Ok. The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/pinctrl/pinctrl-ingenic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index 2f220a47b749..86e71ad703a5 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -4201,8 +4201,6 @@ static int __init ingenic_gpio_probe(struct ingenic_pinctrl *jzpc, err = fwnode_irq_get(fwnode, 0); if (err < 0) return err; - if (!err) - return -EINVAL; jzgc->irq = err; girq = &jzgc->gc.irq; From patchwork Fri May 26 06:38:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256485 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F383A538D for ; Fri, 26 May 2023 06:39:05 +0000 (UTC) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7418E12F; Thu, 25 May 2023 23:39:04 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f4db9987f8so1285550e87.1; Thu, 25 May 2023 23:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083143; x=1687675143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ekbpAMbogTlMCWxkxFZ/eQBJQS9KZeZKKkgzxsIBTZY=; b=swo3Sx3G1UOBDNaL7TLrRZ5pQB/6afRbf8eQBpp9b1OaBl7qkV9Yxk0SqRq0yePA18 ZKv1bPnEl7wMGTPLzvoaZtjDHe8nkwbU5pybFPwKDNauvtpgVcg/O+tw5mTdjHSjStBG yyP3YnlUR51SJ2O95YR7Sp3Ji9z1kAInjJVXtbFGs5Adtb48Zyh7ttRnntgEvp+hF88q v2G+jHWagwpjRk3ZrlNpgM08lGmFRHBp5VCx/SEBP+MX32Hxmjg133eGpcr5PaK5BKel L88+H53RnL1ZExbKN0NwzYroA481IHdtNGLAfDr9xx1sTeo4kYglbNM3i6Jj3uVmhfjz 5p7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083143; x=1687675143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ekbpAMbogTlMCWxkxFZ/eQBJQS9KZeZKKkgzxsIBTZY=; b=FB6TpBrt4hbM+ybDODTgSU4zJRIK5Jwn8LkOHknM5L3sEqnFEImuvHY8jMFOHkepxp Pg4cJrV6gcZtxRzvyDstQj/W3XumAe/ayhxIFYGeR2mnyW8Ey522nG3/VfWPyfbjmPf+ AAErGi55HjeqLg+/db5w7OLuVABYxrqZBV177gK+kufFq+HTGk7bQ/AfGrvoXdx7uZIQ 5Qumy1dzXUOSNyM85QgUsgR/DJcEDr1ygaydt+8Xyldy4JK+PUMzesDDoV2vnXNtfZoK CJKaLdMkiTlVxZwDpZp+H5Cfvg4Vge0CwHx+fIsr7KCCL0mnCzqpjQu4qf38WBYAEV/I PMRg== X-Gm-Message-State: AC+VfDxI3tvNR+SNr7/JU7F+CbJN08cz1WbikS/kevx+7W9CEYj1QRRY iAyC8dd9hO9XFaXB/Dqo1s8= X-Google-Smtp-Source: ACHHUZ7knF9sTUOLQBiCcAr+wHS3578rbREvAyWpopCpkBaInOiXDERlRe36k4kgZYkg7rsGnuWrZQ== X-Received: by 2002:a05:6512:3d90:b0:4f3:a55c:ebdc with SMTP id k16-20020a0565123d9000b004f3a55cebdcmr1440553lfv.17.1685083142646; Thu, 25 May 2023 23:39:02 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id p11-20020a05651211eb00b004f13ca69dc8sm486674lfs.72.2023.05.25.23.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:39:01 -0700 (PDT) Date: Fri, 26 May 2023 09:38:58 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 6/8] pinctrl: pistachio: relax return value check for IRQ get Message-ID: <9db9653eb33d345d305e918215216348a8f193da.1685082026.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net fwnode_irq_get[_byname]() were changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen Acked-by: Linus Walleij Reviewed-by: Jonathan Cameron --- Revision history: - No changes Please note, I took Linus' reply to v4 cover-letter as ack && added the tag. Please let me know if this was not Ok. The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/pinctrl/pinctrl-pistachio.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index 53408344927a..8c50e0091b32 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c @@ -1393,12 +1393,6 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) dev_err(pctl->dev, "Failed to retrieve IRQ for bank %u\n", i); goto err; } - if (!ret) { - fwnode_handle_put(child); - dev_err(pctl->dev, "No IRQ for bank %u\n", i); - ret = -EINVAL; - goto err; - } irq = ret; bank = &pctl->gpio_banks[i]; From patchwork Fri May 26 06:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256486 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB8E3FFB for ; Fri, 26 May 2023 06:39:28 +0000 (UTC) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B724E52; Thu, 25 May 2023 23:39:21 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2af29e51722so3925781fa.1; Thu, 25 May 2023 23:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083159; x=1687675159; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BgKQ1vkNDdmfxW3QiIXw+RFuGncJHJss+SZB9+fpCHg=; b=P8UL9cC2o5Qk8TUJXg/qLPy+TuwqH+ZvSpcZBHL9GWxnX5YEM87KW56drkj82BecGs byUAKqOt/qo1Ly3/1RJbu3JiXAuhOpnfRt77hUNxjMcNaoXNf91K0i7twqChQiWc2per VR+HrcNfzUkfdc33lJKxSb9LK4SGIqkoX7vAKAl/XNYLIZb6edNz6zbVK3O2fEzHYvVX DNpGrJJh0bhI1ylVLhs3R/o99zwBm/bTHZ7rHjWD898nRHRdn288q03HJ20fri7X5vBk Vb/gHNEQeiOyTXB8tMjttLb8vx4R0+Cjp3sb0wl7mMtrVHh0g1z/x6P2wa1Evl7fDCVA Qkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083159; x=1687675159; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BgKQ1vkNDdmfxW3QiIXw+RFuGncJHJss+SZB9+fpCHg=; b=g0uZzN+oloaOjKlVhafkfnJTqwxRm+LeKChrGpYlyztKHBXwqgh5AdAB2v2r81vtOp asL/80MOWKhY13mdw3VL1xQY1y4hKm3fSpJ+JGbWfqxFpvqERUS53fz90yJqxpdL4BWi vviB2DEcHF0S00TycvlxDQToQE2Wv/AbMY4cQDIcxx1DfOMpbrHOiVTa4FbwED4EbmF5 +levPxPK8YgZPCdHBJYxRsUABAsK5GE5xSI0Kx5sjdmnytqLQBG0e44kFrxLgNEF0qNq UES2Q43XEq2J39XNHcdv06fAzDrgC9euDkQa31LIfXjVUqwcfwqUzd9jvwbsIkYQtvnc T3DA== X-Gm-Message-State: AC+VfDxvXEwIna6MwBF+/bSqiKlOmH4lpQtewvOaf5uRoNJBTrOx82kr sDpxEoewS12S+ZDDhC/C2Ns= X-Google-Smtp-Source: ACHHUZ7OYUbMoIrvh5Zlr9sId1vCeetF/jq9fHwu9OnRVkf0weT+x2amMADdAAhh+v70yB2h57C39A== X-Received: by 2002:a2e:8185:0:b0:2ac:7137:5f13 with SMTP id e5-20020a2e8185000000b002ac71375f13mr353634ljg.9.1685083159451; Thu, 25 May 2023 23:39:19 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id x7-20020a2e8807000000b002aa40d705a5sm575524ljh.11.2023.05.25.23.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:39:18 -0700 (PDT) Date: Fri, 26 May 2023 09:39:14 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 7/8] iio: cdc: ad7150: relax return value check for IRQ get Message-ID: <6de4448e9fe46d706bdeddb71ba6923d89ea8f4d.1685082026.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net fwnode_irq_get[_byname]() were changed to not return 0 anymore. The special error case where device-tree based IRQ mapping fails can't no longer be reliably detected from this return value. This yields a functional change in the driver where the mapping failure is treated as an error. The mapping failure can occur for example when the device-tree IRQ information translation call-back(s) (xlate) fail, IRQ domain is not found, IRQ type conflicts, etc. In most cases this indicates an error in the device-tree and special handling is not really required. One more thing to note is that ACPI APIs do not return zero for any failures so this special handling did only apply on device-tree based systems. Drop the special handling for DT mapping failures as these can no longer be separated from other errors at driver side. Change all failures in IRQ getting to be handled by continuing without the events instead of aborting the probe upon certain errors. Signed-off-by: Matti Vaittinen Reviewed-by: Jonathan Cameron --- Revision history: v5 => v6: - Never abort the probe when IRQ getting fails but continue without events. Please note that I don't have the hardware to test this change. Furthermore, testing this type of device-tree error cases is not trivial, as the question we probably dive in is "what happens with the existing users who have errors in the device-tree". Answering to this question is not simple. The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/iio/cdc/ad7150.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c index 79aeb0aaea67..c05e078bba16 100644 --- a/drivers/iio/cdc/ad7150.c +++ b/drivers/iio/cdc/ad7150.c @@ -541,6 +541,7 @@ static int ad7150_probe(struct i2c_client *client) const struct i2c_device_id *id = i2c_client_get_device_id(client); struct ad7150_chip_info *chip; struct iio_dev *indio_dev; + bool use_irq = true; int ret; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); @@ -561,14 +562,13 @@ static int ad7150_probe(struct i2c_client *client) chip->interrupts[0] = fwnode_irq_get(dev_fwnode(&client->dev), 0); if (chip->interrupts[0] < 0) - return chip->interrupts[0]; - if (id->driver_data == AD7150) { + use_irq = false; + else if (id->driver_data == AD7150) { chip->interrupts[1] = fwnode_irq_get(dev_fwnode(&client->dev), 1); if (chip->interrupts[1] < 0) - return chip->interrupts[1]; + use_irq = false; } - if (chip->interrupts[0] && - (id->driver_data == AD7151 || chip->interrupts[1])) { + if (use_irq) { irq_set_status_flags(chip->interrupts[0], IRQ_NOAUTOEN); ret = devm_request_threaded_irq(&client->dev, chip->interrupts[0], From patchwork Fri May 26 06:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256491 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D7062100 for ; Fri, 26 May 2023 06:40:11 +0000 (UTC) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4F610D7; Thu, 25 May 2023 23:39:43 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f4b2bc1565so349122e87.2; Thu, 25 May 2023 23:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083182; x=1687675182; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=r8WxArmJoZC8xqHylJdU5AGk+XIbCJbogTeDfs0y2fc=; b=kZlxofiucY8/Lfp0amC/THuRlzjVm4QfLqqW0v8XoWvGEazpIcKfv+6Y3Hkn28xoPU QfGXd7HkgrTwQ7CNDgIIxnupjEz612uEqGABVzbMzhsb3UBA2jm0mgt2VHWoKOAuXmsN VoFAX2icB6TKFkhF6SS3ZcDfsVrB95m4IDnEBZKQRCzUMgKrO3rab67HUeLHwPmnbOkk eU6j760c569VapRpeY/+vjs6apRsTp67TJowAAq0MNV7LVC9PoFNzE9UR+PZOD/CuW3p ChtTT4YO9tj+T6H6Cksspq3qsVrEGp/722KN9wUHFz63wiU2cDlaZyUWlHhxkheWZ0DC eYfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083182; x=1687675182; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r8WxArmJoZC8xqHylJdU5AGk+XIbCJbogTeDfs0y2fc=; b=YFA9TIX8E2PH6upJmkKC6t4+seOzjNNIbI3lSIpSBBAaCUiwktzzRYaUtgTbZFXTZt sHYzTxwnJOd6dfysK4sx1/vHDDJR7WlZdmVUPkprG7FMUmbvSsEGmyYi3eHVoresdeMy jlyJFUThzZdYnKXiKY80/iF/q94osJEDAkbWOuBt3Px8xIzWKXTX3eoaWDf8fWNg3dgP f4/AR8toZDRDUcYxG1DyLHbL1VPQuVL64JB6mKQ/AB8zp8TGLFNVyLHX/EpbM5cAy3kD ksMxS/oQ56Q4X+zL5e2mKbSy4Yh7hWSP3xLwgCu/LK666xrjMQTZXvcN5JCmkTWjd/u1 fXeQ== X-Gm-Message-State: AC+VfDx9Sz/Tzh85iQLtm0Ye2fhRMzhx2T0gmaPsTQjjTMFBacU2Mk0A jZcBEOnIlHVpSi8FzGyd62Y= X-Google-Smtp-Source: ACHHUZ7suqP34B7zhh7d+MVDHYwTRa3XCDJTVoRDJ3idVkc5oKu76GbAuL5+UGbLruSq7U8YqZfIpQ== X-Received: by 2002:ac2:5deb:0:b0:4eb:1361:895c with SMTP id z11-20020ac25deb000000b004eb1361895cmr168335lfq.55.1685083181695; Thu, 25 May 2023 23:39:41 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id a22-20020a19f816000000b004f3789c8bd5sm488291lff.132.2023.05.25.23.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:39:41 -0700 (PDT) Date: Fri, 26 May 2023 09:39:37 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 8/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: <1c77cca2bb4a61133ebfc6833516981c98fb48b4.1685082026.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net The fwnode_irq_get_byname() was changed to not return 0 upon failure so return value check can be adjusted to reflect the change. Reviewed-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Matti Vaittinen Reviewed-by: Jonathan Cameron --- Revision history: v5 =>: - No changes v4 => v5: - Added back after this was accidentally dropped at v4. Depends on the mentioned return value change which is in patch 1/2. The return value change does also cause a functional change here. Eg. when IRQ mapping fails, the fwnode_irq_get_byname() no longer returns zero. This will cause also the probe here to return nonzero failure. I guess this is desired behaviour - but I would appreciate any confirmation. Please, see also previous discussion here: https://lore.kernel.org/all/fbd52f5f5253b382b8d7b3e8046134de29f965b8.1666710197.git.mazziesaccount@gmail.com/ Another suggestion has been to drop the check altogether. I am slightly reluctant on doing that unless it gets confirmed that is the "right thing to do". --- drivers/i2c/i2c-smbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 138c3f5e0093..893fe7cd3e41 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -129,7 +129,7 @@ static int smbalert_probe(struct i2c_client *ara) } else { irq = fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent), "smbus_alert"); - if (irq <= 0) + if (irq < 0) return irq; }