From patchwork Mon May 29 06:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 687067 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 EE124C7EE31 for ; Mon, 29 May 2023 06:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbjE2GWn (ORCPT ); Mon, 29 May 2023 02:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbjE2GWl (ORCPT ); Mon, 29 May 2023 02:22:41 -0400 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 C5B10C2; Sun, 28 May 2023 23:22:39 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3b5881734so3268562e87.0; Sun, 28 May 2023 23:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341358; x=1687933358; 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=JRZkhSfNi/CahwvYTKjgmeTw6RKVKTnQbqpayNzly3w=; b=NgR/fbJPAxlA6ez4qMq0Ef7YeLvwdGjfoAR11dyQrwOqRT3j5c5e3HOaCb7pOtnDWO xHoYdgZIg7kLKjsza+J0mrXKaFWuH74btl0Y/4OFE9xhyn6yppFKZtCO7WwDzLR9SWiq v+zK4NTRcstq4UOtSjQ5OyG/bsgXK11Eq20CMlIBJEhRSn3ROKcu3A0ijeUqmCWj4rq7 M+ScwPFEoLcV7G8Ylh3Z8HQsaXK82shh4Oj95VzQLO893tA/3VL/epny988lwT7cyTED U2TBpUQXCuBaISPLj7a0T++zoH2qn7WZfIotXwPNNYoJFEDPjzAB+y5CvdSp0xNe14bn gLIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341358; x=1687933358; 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=JRZkhSfNi/CahwvYTKjgmeTw6RKVKTnQbqpayNzly3w=; b=CRguAAEK8C1khJO4d0uAJlQyn24mbUn50ejSgeritJ1m8brqAY9q/iODcdFY7sCpty /jhgL8YrKcZTw2ccReEIMqaEKpmArGyvVDLuaECZN5ONRLfIVUY7V7rg1/plNpzsLwIT 7PyJeJN5d7C5/Yxm6ewEMVzHgZ0AuTm4eYNe3fCDZaq0OM2gD+NEeNim7Xb1sMNRAGOq 5HELW01h6/Vc7R598nTql/wCYI8JoCO07HiqnzlvEJUfEew4bTSP0tWnA9AcnnKh3yg5 WbP44B5oM/nNxRBTbY5Lwp7aRXK9K4Q2AEzj+v/zrq9/CIyzoe9DOnFYVt1X00tPa4wr QxJw== X-Gm-Message-State: AC+VfDyvAJ6Yihnej3sauXvhDBAwsh7eVVVOSvnJcd52da/UWbYG9mkh rjbgjRdd3tkJEFu4rTFHTe4= X-Google-Smtp-Source: ACHHUZ6wvKe9g6Qbup/bwc9NSfP1EJvYN8Xsp6qQDhosGVkK5RzPW6tDvpf3J5FhHk0AlCPih7BAVg== X-Received: by 2002:ac2:5298:0:b0:4f1:5010:4b34 with SMTP id q24-20020ac25298000000b004f150104b34mr3954548lfm.18.1685341357703; Sun, 28 May 2023 23:22:37 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id z3-20020a19f703000000b004f11eb32f20sm1870130lfe.13.2023.05.28.23.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:22:37 -0700 (PDT) Date: Mon, 29 May 2023 09:22:33 +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 v7 1/9] drivers: fwnode: fix fwnode_irq_get[_byname]() Message-ID: <3e64fe592dc99e27ef9a0b247fc49fa26b6b8a58.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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 Mon May 29 06:22:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 686782 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 922CBC7EE29 for ; Mon, 29 May 2023 06:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231560AbjE2GXH (ORCPT ); Mon, 29 May 2023 02:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbjE2GXG (ORCPT ); Mon, 29 May 2023 02:23:06 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59385D8; Sun, 28 May 2023 23:22:56 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2af1a7d2f6aso30906891fa.1; Sun, 28 May 2023 23:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341374; x=1687933374; 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=Yfyg6NKftjZO/4gz0JHhtsokbfeyGcV0luSB2BRlKAo=; b=E9Tt+BNoXN5iXTWmvKUwKPWj/9MUIlJIXaC4DqH1e+JKbC3NNBssryaMJPRq0qDybI ro6d141wA0yjh4trX4LPM9h67u5Nzbu1VeAcgEwAIDfhfy/yy1e0kzMjzow2dhcC0Ayn Tl8g1G29hXksD+SsHttxqNaVeYgPn495ARpMZe8iDgyEk4p3MMYQkiI2EBxCJj0Kcmh1 ygk6hUmmBElyaEfrBU7tD0Od3qk07vsqqUEczGJA185E43VL1xawyj9aqMuLRt4IzUMh yfa00g595ramofRyoOOXgehsarvLE6z3F0ILA1FeqHT/n1iIBEusMQulVyo9StgzWuau n70A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341374; x=1687933374; 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=Yfyg6NKftjZO/4gz0JHhtsokbfeyGcV0luSB2BRlKAo=; b=ANTIV1I+3Mo2VFjpDUkn14z67JY86Fx0vb7VXu6XhQLLqHmamqHiLuo3DURc89BtC1 aBssDqmPA2HsSU9K37cMCAMnekpvilA4LCy2pEcQpYVfXlivsTy0y37IPNtQP6D8hHbW g3FLYFnkvXJc2A6/lpjvbjs9NLmzl6UtenoT4I1PZg9oy0jEmPoKuBiFuroyq50+lT2n F1hjQVujOaUg2pM34UF83DJRffFlY7WeLnSQwxAcIG/5kAb6oHB23YBsZgHHR2Mak/TB QPbJ4FI/c82+NyhS/+blzqyx5z670Gm9bk+ahNbK1OwyQEKw6KSeFJu7ehcpJPXGbtp1 O8cA== X-Gm-Message-State: AC+VfDx++MzFa7hRJ27pFp5jomzmmM5ZQTpMlYno3YpYgWchEuHc/Gq5 RM+MWO+XLj9KpHHATvbu8Wk= X-Google-Smtp-Source: ACHHUZ4eQuwS42uy0fymxkMMy4zn7woNyo0QvtaUdMk9NpK0WPd51A1m/jmdH76EIq9T5blchR5vIQ== X-Received: by 2002:a2e:988a:0:b0:2af:19dd:ecda with SMTP id b10-20020a2e988a000000b002af19ddecdamr3195700ljj.45.1685341374404; Sun, 28 May 2023 23:22:54 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id f1-20020a2e3801000000b002ac7a715585sm2310218lja.30.2023.05.28.23.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:22:53 -0700 (PDT) Date: Mon, 29 May 2023 09:22:49 +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 v7 2/9] iio: mb1232: relax return value check for IRQ get Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Mon May 29 06:23:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 687066 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 B179CC7EE23 for ; Mon, 29 May 2023 06:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbjE2GXk (ORCPT ); Mon, 29 May 2023 02:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjE2GXj (ORCPT ); Mon, 29 May 2023 02:23:39 -0400 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 C5C7F134; Sun, 28 May 2023 23:23:13 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f4d80bac38so3085033e87.2; Sun, 28 May 2023 23:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341392; x=1687933392; 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=5OqPDAL2F4QbXTdxLABb43Nxq6BhvQH6mCnX6PKiQV0=; b=FbDQWAv/B8gGGeiI9XYgfZtuUTwRPawmowVgzsiILnKJxdjkygbCHLuFJeqeI1tqBr Id+hfBeeU/CnrNOxQ9ryAfsACFaTaJE4brEpPkJ4A9bX5bA563QEfxc3OwzfsXdIdK+b wgawaMDoZjtajPCqUW/xitf6H9mgUO24szOTRDakwCSIKjge+vRSQtzA8QYpAwjwSwvM 1XLrMVsK/y4t2+Dq5T0MPCRhNEQILwwZxSV0+8E114azpYreE+14ugKumaDACaZSY352 dfI6X6htSm+EXP5zKWJM/yjEAgZcNUOw9dODX+twIoIrHELPtkO9RdyU+kMdZymWoHiI c32w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341392; x=1687933392; 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=5OqPDAL2F4QbXTdxLABb43Nxq6BhvQH6mCnX6PKiQV0=; b=d9fyu5gZG54cdu4/ESUFBiFii0j085hC7zHX/l8b0FnsmeyCjdoe+AFqr9+kZRGWXM SVJJk1Oo3JUaRs3C5G1W3e0i0hJr0gWdZalpAhC42Hd7bcFzsukcGpjuvi74aLYQzkV4 59ZMC4YFNyYiPebsvnyh3raooriEVz+jT7lP/lSpP8qh15O4E8EkF4MK7tWtO4EzyvN6 DWpfCCtzeOTrkqVR+5H+RUhRb2RkbGZ6Zl/1zqJ1UVU60zyFAdLyJ9g5i4UGlGs4ZUDS kdCgnCBG0oXTcLRSDw8KZcNcyiOlEx1n4UA7U/EqmHlGbM0S4TrZ4hZ15CDFsfS0lW6M xfWw== X-Gm-Message-State: AC+VfDx+LcysKdkgJ0CaX/fQ/FD8sGNx0xgVYyyEpK5gWNn/Mbdx2+7M l1b8akzvlkfWUQUITYXcv4k= X-Google-Smtp-Source: ACHHUZ7JcImE4kXr2D46Vq9JaL8Mo4Yl/T/FzxOTvbjvWHdBLI8O3eGN+4nzVTxjS3G8Qg2pD54CHw== X-Received: by 2002:ac2:5306:0:b0:4f3:b97c:2d91 with SMTP id c6-20020ac25306000000b004f3b97c2d91mr3046276lfh.66.1685341391834; Sun, 28 May 2023 23:23:11 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w10-20020ac2442a000000b004eb4357122bsm1844301lfl.259.2023.05.28.23.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:23:11 -0700 (PDT) Date: Mon, 29 May 2023 09:23:07 +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 v7 3/9] iio: cdc: ad7150: relax return value check for IRQ get Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Mon May 29 06:23:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 686781 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 D6CDCC7EE2F for ; Mon, 29 May 2023 06:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbjE2GYG (ORCPT ); Mon, 29 May 2023 02:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231455AbjE2GYF (ORCPT ); Mon, 29 May 2023 02:24:05 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40ADAF; Sun, 28 May 2023 23:23:29 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2af1c884b08so36191041fa.1; Sun, 28 May 2023 23:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341408; x=1687933408; 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=qAYjfYPDkeseUEX3Qju/rMoDAuLOVXMDR9FoKi3lXW8=; b=LdGoCbTSxryOs8Qo3Ri/QyjATODUIwbB9X0bApaeks2mrJVyUWgpAbsz4csJjgqLVy r4MJ9L74W/bkS4zpCN14qkNvZDnhjUQHBzEUuPOj43+ZPbyHQ+YwU5VelRkeEwrRhgfV XAzUHoKVuRdP6rJ7MGfBNA8vLN7lvDl2ff4KWd7T6eIMMrFkeO4bV5rfr9XxWq+GzDZd R+0L28kyPVXPITJZUEXwl+2u+m9hKMH1Hs05+ubkfEv31dQ9YvN9EiOrQ309jxzSoYFm OEuGO7CgfEXSN5G30leLZMDnoXFoLcTnfj+hvBcLvVAujxOYK/2Yg6RJD30zSl+1sQyp 1jLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341408; x=1687933408; 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=qAYjfYPDkeseUEX3Qju/rMoDAuLOVXMDR9FoKi3lXW8=; b=ZS3m84CicR9JqCn/1vdS5A/ngTe0qE6Be8gcxTKfJTqzVXPe5ZgroV0oeNamVgvMZb vWjBYaVkqcw1VwChq7jur0VUEsVEqA8/OAWanBs6NMQqMKs1sk/0yqtF9dSrVVQrabrb VDKkqKdX4LTy/873wLAZh4vxdET+I0GC8oDlAOmn8I8p3FktMXFyX3aCo8gQq8QtJ47r 7F8rtWq/Ky+VBNb/3jUGdUYafA16sbz4Q0OkKgK1Zr5XhYRiRvdt9W1ZaSxUJIY5ey3+ Y1pqlzYJq+nK+HWeBNNNYkYnmeO4ez5l9U3nmtpHrJB7rDPx6vcBBNstzU/Dtbu9VNG0 57CA== X-Gm-Message-State: AC+VfDyEYHsER5H2Z993HATrJGTapiTWiQ+Xe2TehTZvFQDIOmJbc9b+ BDvzq9znoRj2iccPovMR5e0= X-Google-Smtp-Source: ACHHUZ6Wzd8EORP/soOSqvLc1RQARXsD4vdEjqHtxoqGB6E7ai03uoQZNFPpavZeUpcBp1H64LhQUQ== X-Received: by 2002:a05:651c:2044:b0:2af:222d:9695 with SMTP id t4-20020a05651c204400b002af222d9695mr2224914ljo.9.1685341407947; Sun, 28 May 2023 23:23:27 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id u3-20020a2e9b03000000b002aeee2a093csm2306817lji.59.2023.05.28.23.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:23:27 -0700 (PDT) Date: Mon, 29 May 2023 09:23:23 +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 v7 4/9] pinctrl: wpcm450: relax return value check for IRQ get Message-ID: <659ca38e756b724b4192ff2923e8fdf6970dcb8a.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Mon May 29 06:23: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: 687064 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 7A274C7EE32 for ; Mon, 29 May 2023 06:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjE2GZB (ORCPT ); Mon, 29 May 2023 02:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbjE2GYR (ORCPT ); Mon, 29 May 2023 02:24:17 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B270B120; Sun, 28 May 2023 23:23:45 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2af189d323fso45624371fa.1; Sun, 28 May 2023 23:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341424; x=1687933424; 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=w2htrHoUb05zFmZyVZPES7QukPQYRc3jomIeB/klZj4=; b=IxHCLBEQHZEy3VFtdTPnx9aH/KeZUSVVV6J2ZxIGnbc6vzCFZcXnJRaiNvV9bp87IR zPdIC7pG2Has+iX4gz80yNYcIrsYEkyozPgr13tiiEdLJrXVqkgfgyWW/OPQhzawhhPk PDS2T7BMLVOup6Qy3jduIa7Vkxg2OIusXmz9zzSJCDP7enxn9lPJ0EdZ+FQTqaER86Gg nIcVREeVCpEmUL3H330jO9BSlBUdDtFL9zE7gu+ZWhHgglTA1g2wdxxSVlWnDO6vn1QO UglBZjC0xm17V+cKrFTP6Vi0XFSEPvBxGy30o/IGNL9ET8y8mVDX/7F3XJUXbrYspHmH uMsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341424; x=1687933424; 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=w2htrHoUb05zFmZyVZPES7QukPQYRc3jomIeB/klZj4=; b=BX5k2U9SKMCqUw9vNIn8AdG+MYuPjQvXSPV6k52yS2DE376XomO+EjaFZaPyeyjr7M hMMzlJ9yeMhUCPIJq5E3EcC2H32az6nEJKnjZMXTD6TL82znKi6epe91cyDitX6BcwTD hZqEnL//TyTxsg/B77kIbCNJ2iyyOPi1KkygbRB4+VkVnUhCneVEoyu+InZIGWNi0Mnz 9SbxmKuTkQwUp0JSiOVotROuMSLcpeXoe/HLVdhYRKtHY8NtfTUQX9lVcTmMJq++G7Sc KqVEKakzj7ya0a+aVp4jqFlDAhXchAQQ1URnP64cy566onp04eWhw/ghw6g5YMk4cAf2 F2MQ== X-Gm-Message-State: AC+VfDzm/5gW1xM6Et83hAv2SzqRlXxi30x2urYXeOa3TSzSZJJ+/ZiB YDRMTVig22aMTroT1V8GpUA= X-Google-Smtp-Source: ACHHUZ5EsZDMvzcaTCxKwN7I1InRz+1d3odGsFjAUNoMY0h8dmEoco0VfBem50IfM5IWIoLSRPDWqg== X-Received: by 2002:a05:6512:2302:b0:4ed:c64a:4aa8 with SMTP id o2-20020a056512230200b004edc64a4aa8mr2821216lfu.6.1685341423888; Sun, 28 May 2023 23:23:43 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id v3-20020a056512048300b004eb0c18efc2sm1833053lfq.221.2023.05.28.23.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:23:43 -0700 (PDT) Date: Mon, 29 May 2023 09:23: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 v7 5/9] pinctrl: ingenic: relax return value check for IRQ get Message-ID: <2b52e5dcdcc50e2f932184b5816e5f7ce678210a.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Mon May 29 06:23:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 687065 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 AF70CC7EE29 for ; Mon, 29 May 2023 06:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231611AbjE2GYg (ORCPT ); Mon, 29 May 2023 02:24:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231475AbjE2GYe (ORCPT ); Mon, 29 May 2023 02:24:34 -0400 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 69974110; Sun, 28 May 2023 23:24:02 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3a611b3ddso5089703e87.0; Sun, 28 May 2023 23:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341440; x=1687933440; 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=uEmuOv7fyHRZPnJixXOmvNLBHdAL/mnG87N9Mya3BSM=; b=UHxHMFKCeb7EfKc/IxtN6IKsRrbAG5vpabv6bNlDzNSqbjDn2rb5+AfDSAgs5f1jlB +UmvYBtFCAdHHId0KdRpSh5MjkZ1U2bkl5ux58LRQC1iA3YbDcfyKg3cN5A/SNxXf0Vz q7lRK4l6pdWvBe0WoZc3S2fukzneaipQ9dZ865TPKIPdQgNX7jAcwNq6e80MjYS8lf6r aY/5CcHejY4Gn4VDmVBLKcBBP0h8eR8EL6qxknsm9ZT+Nvyk69C00g0FlBiMpsZDnYWq T9yrkOsI7GuAYaPPG49vyYz3HVdZ5duXDZdCKwVtGC5mQJhYxMXkY9Gtg5x7sxrTmHn4 8JbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341440; x=1687933440; 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=uEmuOv7fyHRZPnJixXOmvNLBHdAL/mnG87N9Mya3BSM=; b=PloHy1eIcIgm7lUrOMf/1lHKTia9Avhg8mmIXgqgSVlNROyB1bXb8Uo+YlskcR+6dN jvvYRN+IHaBB6xsg2oDmz4reTyRGzk2v0eIIhK9YmCl1SHeKowAiqaoFCvC0QnTpmrZm q67uPj+guc7IQfGThuaQDWg+vJ7C9fI0yL3FAKS+ULceRxbi6AkhHLqhnvgkJ59X9+dZ iJ4JT3uJm2bnzPofuNN9cOkuJojk1ojuZu4MRB9wNq3T4sfhUu6gbok6Iqb1SgTBkt4p UBatfvu2bl1VaxU9k9nKDdxz/FG1++tkT2zZNQtR3b9A9KRPcBRAc9dXPuZYYK+9icw1 V4mw== X-Gm-Message-State: AC+VfDxHRD/erezCNvOsk3La7YHlGF9ZJU2eczgVdNVXvVieLe8yNVzz 3S2q2CSkWxQhNP9VaVFY4wVDHo2NHG4= X-Google-Smtp-Source: ACHHUZ4A4w5AYq5DZKR8KECg7aiQfo1vTJZS23CTUj+cq12URjvIZ6YO33hOKPbIS9EDo9zLBGoTtA== X-Received: by 2002:a05:6512:3d25:b0:4ef:edb4:2c77 with SMTP id d37-20020a0565123d2500b004efedb42c77mr2688210lfv.11.1685341440377; Sun, 28 May 2023 23:24:00 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id f2-20020a19ae02000000b004f3a90b195esm1859534lfc.51.2023.05.28.23.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:23:59 -0700 (PDT) Date: Mon, 29 May 2023 09:23:55 +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 v7 6/9] pinctrl: pistachio: relax return value check for IRQ get Message-ID: <08188d9dd325f1f8b13f9173af00c03d0c27c2e0.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Mon May 29 06:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 686780 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 1E069C7EE2F for ; Mon, 29 May 2023 06:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbjE2GZA (ORCPT ); Mon, 29 May 2023 02:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbjE2GYv (ORCPT ); Mon, 29 May 2023 02:24:51 -0400 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 5EEF3EC; Sun, 28 May 2023 23:24:22 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f4f89f71b8so1195419e87.3; Sun, 28 May 2023 23:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341457; x=1687933457; 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=gMGKMQ5heIZqIPqdt41yF6tIdWNRsHLiOnUodPGYbyg=; b=pxhc4f3yCvamPD7Ifu2P05204ThyP/GqLYqkRq9erG7F4i888mn2SRGiMB4/jXDDJs mMtR2pdV5Iu319rSLAotcbz3Nvl0JZDSH9LA+kB30vDyQTsSsuUGMtPj93W4q87S+4pC E0HrnmuZEbxpo0J4V/nCB2I+BjSfaQ9S4zbdQlgkdbbUF3KQQcncex3ETuLc/wWposG+ xhgTCu7pFYi+LN6Zp2K5n36EDGKluVAMhJZMA1G/xxf9Ex2gyz9uUQJXb7neWn0VuMMC QaGVz6c4ONzIPiPLnG2o/OIiJ6GBbu/YiHLN6UjmAohe0ekLfI5qAwIqWdiWc1XuABIc eCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341457; x=1687933457; 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=gMGKMQ5heIZqIPqdt41yF6tIdWNRsHLiOnUodPGYbyg=; b=RTVL6ZcX8FQ0Nf+AIYVa2OKO0v3QDJUVkj2GxFOnVjhu4JeS1LuGEjFNs/Pj8qRwFR YVH7qVfSR/z1O0/92bDJBxLu3Aw9bB6ZFzO+UltzUJIJ38Ye7ADjbqKXSz502EvRlOXE hIiuYHr/WmE8iqw3SCBwrt3Mhr2NuU60hxRtp+U8UkV3hh/2YXNtkTpHUYNfPMaBTFQC PSFKQJ1SSDvGfA50x0MQVgAabjdW/v/apufpOJH5NtTTHZpzHcG1ccX8XvOFWJorccV9 MHVA5+Cosh+ab7X0l+Y2YioimPLt/VBgnh0lREAEeVdxirQCeWXJABdxxmEbKfe5EyAl SgYg== X-Gm-Message-State: AC+VfDzsl0zjX3MYspWHszLPt7CmpUFW79sSHUDfBQxntWG6TaOK3y3y PiUPRHASyTlLSqqd0ZIZq7c= X-Google-Smtp-Source: ACHHUZ7Zh6z2ke5UbYWZOvOrsExI7SxqLEdFdCNeOv4MdD+rb76OPi6JznRKt4oahaSfgpjTXZ1yTw== X-Received: by 2002:ac2:4855:0:b0:4f3:b6b8:dabb with SMTP id 21-20020ac24855000000b004f3b6b8dabbmr3311641lfy.13.1685341456877; Sun, 28 May 2023 23:24:16 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w9-20020ac24429000000b004f4ce1d4df6sm1844987lfl.47.2023.05.28.23.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:24:16 -0700 (PDT) Date: Mon, 29 May 2023 09:24:12 +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 v7 7/9] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: <73a0af48bffe99a9d4b94b1f986258021eea6182.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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/N. 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; } From patchwork Mon May 29 06:24: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: 686779 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 ACF49C7EE29 for ; Mon, 29 May 2023 06:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231538AbjE2GZU (ORCPT ); Mon, 29 May 2023 02:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231639AbjE2GZR (ORCPT ); Mon, 29 May 2023 02:25:17 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F1F11B6; Sun, 28 May 2023 23:24:44 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2af20198f20so29804651fa.0; Sun, 28 May 2023 23:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341475; x=1687933475; 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=OZRQfz643dmJHeeo+jkhXyvA3F1dCaDB2UQgCJF1mJ8=; b=Vv79P5w9D8h+XFDM95DLNQIVFZ5ylVvfzphxGNnUlDerYoJDaJkY43xI3mAuUfZm0z C4fob+gOq8w3UMfh0SSQGKfk9tcsd9Nk/OcAaL2OXUJNrFrebQM6K/eZWFdiBNwewpMR ovK7SpJ8g7eS+u0DK1IbINs6g9baH4okHVEj/GiQforgbnEHTgIE12hpV6YazIkqllSY LN/xGaiY7b4Cb9RDIHHhQvA2vOKR6tslRfXB3vrOwvH/5FBRTamlbXDwtkHwLP8ou34u SLC6CErI3ZG4MJp2VmVs5FKOOe3lIV+ztG5v6vJvTEU5wq/IXgWRfOm9ngHFexvhvY6L wIkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341475; x=1687933475; 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=OZRQfz643dmJHeeo+jkhXyvA3F1dCaDB2UQgCJF1mJ8=; b=erMNR6RsSMn6Ry8blTEAuiUoXjJbiJSLpPJ6sW7QkDNGSHI5xpc4fXkTswcN40Iqgv Utn8Txt8t+EQoOfVZ3YgNOiO+qxTt9W9ApETWasTgIBlGLTlFfmpDbOjI1Tc5+XVskUV QDksmm5isMDUtd+O0ZujEQRQdGlsjwmkiQrpy3t5G8dJC+UBgEesKwaEx4lHmK40D6lC B70tKQ/Vhji7buvS/bW7Gll1jtSiLWJmXwTTE+QkYPAmvabotALGMOOBRDVu/3g7O8M0 jbM2QCSO9Vp9kpcaEevYCQapIzkMzpZrNKLLiUuGxktHuYG+yLDob+IFo8+d0Uhy4VWt a7IA== X-Gm-Message-State: AC+VfDzvpSX97rz8ISpSiozLQbTXkNs+43GZhgcTD/a4tOK75SPQfo1H Mc2gBmyvA9r+vKt4ipbKnXs= X-Google-Smtp-Source: ACHHUZ7FtmSMOib8Ov0ArZ3oVpwS2pIyq4LIkauz+GxfTaYPkIg0JToW3ToziUlQWKilosw5qbF0cA== X-Received: by 2002:a2e:3e0e:0:b0:2ac:82c1:5a3d with SMTP id l14-20020a2e3e0e000000b002ac82c15a3dmr3693931lja.23.1685341475524; Sun, 28 May 2023 23:24:35 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id s10-20020a2e98ca000000b002aa4713b925sm2305506ljj.21.2023.05.28.23.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:24:34 -0700 (PDT) Date: Mon, 29 May 2023 09:24: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 v7 8/9] net-next: mvpp2: relax return value check for IRQ get Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.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 Mon May 29 06:25: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: 687063 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 7F10AC7EE32 for ; Mon, 29 May 2023 06:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbjE2G0D (ORCPT ); Mon, 29 May 2023 02:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbjE2G0B (ORCPT ); Mon, 29 May 2023 02:26:01 -0400 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 65C9819C; Sun, 28 May 2023 23:25:29 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4eed764a10cso3043213e87.0; Sun, 28 May 2023 23:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341520; x=1687933520; 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=C8+bnKjskXykSg/iKyM4tx22OBuA1gQnjvmBSIg+LQg=; b=fFliZVkMY6bLJAuYH+zFK4+JAx6PcjcFknIiq781O2oY3I435SWATGl1m+BLfl752X 9VF5qvU7gxfrJcCYmb0eAg3X65C+BMJ3nFUxTBQ0/y7jHU9eQ+9tbfJbLNrfDTBwom73 tQ00BJhN236S6OG3HE2gbGrJqlo6ls+rTxX7WUcgwmL/An/DgfvtOswQbaWmjbRxgJJd dr0+1qJ+ZTSsgElhFGpPQ/0V+7uEz9iu9rxuT0m81vFZzJ9NcoAa0ZItX4q4fvbwHX4O SCCYEQsoM0lVFBLlzpYs2CaibCeIqOOYaOj2PJPNS1znR8dAxIHFdobqPTvcE3rtDhDr 7eYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341520; x=1687933520; 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=C8+bnKjskXykSg/iKyM4tx22OBuA1gQnjvmBSIg+LQg=; b=I9yhLMOZUDVehKqgErP+HKR9ptEVmAEmfJarvkBbpi9y3Kcb4FyLXGnAVq7sNp/a/w M1489/diKS6uSZO71GtDWVBsjVbbZNYm/dpQ9dtbRPt/Gc0TNTXRrqmgH4HVtjcdiXwP zwF5xV+yLzoq3fbflTVGpDxb8CMtCDb1u/OF04EzvaYpfQPCt/ne6wBQJnXKB5cgCVpw /BfsHx0DmebcOs20+y6kX1myZMcqK7gJKiVM51pQQuSfXz4txMCszTYFRomA4Mhfr2yp XPYYl4QnZGb5+2xps2atHjtzqzboibqGJ6XHz3GXcJNiDBUgRSWycuJD6PmWG1WOoMPd 87pg== X-Gm-Message-State: AC+VfDztJ4/tdjG2aPPeZWt3LJacl3tWD1Xh5JDEMj58Q2I1d/+sKhpe i6Cct/TCnnM1G5VhCiMZo5s= X-Google-Smtp-Source: ACHHUZ6Xj6UKjjPlJgrfE9uMHkKDWTfWA5sR45BQylbXf8Ay6rkSnz/XTqU+Q3yir0vd0i1zrhMoUw== X-Received: by 2002:ac2:4477:0:b0:4f5:76a:2033 with SMTP id y23-20020ac24477000000b004f5076a2033mr46640lfl.25.1685341520423; Sun, 28 May 2023 23:25:20 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id c18-20020a197612000000b004efd3c2b746sm1857330lff.162.2023.05.28.23.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:25:19 -0700 (PDT) Date: Mon, 29 May 2023 09:25: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 v7 9/9] net-next: mvpp2: don't shadow error Message-ID: <16d2b244566d4993c8fb26e1e2fbd178f46587f4.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Do not overwrite error from lower layers but return the actual error to user if obtaining an IRQ fails. Suggested-by: Andy Shevchenko Suggested-by: Jonathan Cameron Signed-off-by: Matti Vaittinen --- Revision history: v7: New patch drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 5b987af306a5..57cacdcd49ea 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -5830,13 +5830,13 @@ static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port, } if (port_node) - v->irq = of_irq_get_byname(port_node, irqname); + ret = of_irq_get_byname(port_node, irqname); else - v->irq = fwnode_irq_get(port->fwnode, i); - if (v->irq < 0) { - ret = -EINVAL; + ret = fwnode_irq_get(port->fwnode, i); + if (ret < 0) goto err; - } + + v->irq = ret; netif_napi_add(port->dev, &v->napi, mvpp2_poll); }