From patchwork Tue May 16 07:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242662 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 806D1C77B7F for ; Tue, 16 May 2023 07:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230522AbjEPHMe (ORCPT ); Tue, 16 May 2023 03:12:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjEPHMd (ORCPT ); Tue, 16 May 2023 03:12:33 -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 DE1D935AD; Tue, 16 May 2023 00:12:28 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so12906237e87.2; Tue, 16 May 2023 00:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221147; x=1686813147; 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=nIQsLaHssKkl6pMh4izl/5JY75K4E7vPiAyWjhDInUQ=; b=kVyZEfq6Q5jbhZ2IenNtfFHWP9ROgSqyZjUzcQyz17v9aApeHKzTAiCKMRPPt8Cz+U sO1aikJBvml29mD0dna23tcxwWy8iHg0X56CibVfXurzDAHBQtvy3SPRBkQD9BUmzSRK UWGib1T+IESAZ5lTgswFoUp48FFp3s7chTAeep0cf2bZw5QodQ3QQVMiATwuiLdfSeqx 8bvDST1CyN0vGgJFpxQNPn9RUEOeyQGRQBxtrynZzueM9HkG9B5sPKXdhwlOqikCnhmx j3hmIizOF/ix81U+k34v3TwnOPw5iu3mcbo/QwSHusrF9rI9a7AGDinMrTOB9bxl6DxC yjfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221147; x=1686813147; 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=nIQsLaHssKkl6pMh4izl/5JY75K4E7vPiAyWjhDInUQ=; b=VqqZT1yZgoVMCjRDxsTnz/cs0Us6ZIyk3E728W8wr0Q93hrTZwVmYndt1WKwmNpM0Z x60bjYm3kDUla42gGLoFqogqR1VRi+I66X4JUpHgJlS5Jxe3r1phbs/lBPkvvWsqCyb/ +lYiqRE/XGxFdEQrb2NfmvgLi7GiyiTd2BSavBB/uUNLAiSPSOtgKaUy4JK8kzSSyh+2 q8pbGnTTVK6YF/TL4//LpcxgZS42f3dZQctbuAxb5SEFckhED2w04DputPYd59ZfB5xX SVSuLvvvi2X1KdrZh9fDp6qq7cb8H6nt+KMoc9Uy6iETbitbztcsI2X1Et7MASTz/6N/ RyMg== X-Gm-Message-State: AC+VfDysQ7KlMsmFR/Y0grRkGP/UWVU0NdiI6BMHLDxcuQMzMJJSwZRQ Dk9MOzWOGY03VwbhahS3hjU= X-Google-Smtp-Source: ACHHUZ6JEHZtYC7O57uCCGGCuU8NkL8W8zXPnQeRN4Mi+ogX1rDd1FtJEtvrACaEgE9PUk2Ib2pPaQ== X-Received: by 2002:ac2:48a1:0:b0:4f3:8823:ebe9 with SMTP id u1-20020ac248a1000000b004f38823ebe9mr715145lfg.22.1684221146822; Tue, 16 May 2023 00:12:26 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id g14-20020a19ee0e000000b004f25c29f64esm2700143lfb.176.2023.05.16.00.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:12:26 -0700 (PDT) Date: Tue, 16 May 2023 10:12:21 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 1/7] drivers: fwnode: fix fwnode_irq_get[_byname]() Message-ID: <339cc23ccae4580d5551cc2b6b9b4afdde48f25e.1684220962.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 --- I dropped the existing reviewed-by tags because change to fwnode_irq_get() was added. Revision history: 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 Tue May 16 07:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242663 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 08974C7EE24 for ; Tue, 16 May 2023 07:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbjEPHND (ORCPT ); Tue, 16 May 2023 03:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbjEPHMw (ORCPT ); Tue, 16 May 2023 03:12:52 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBF6E1BD3; Tue, 16 May 2023 00:12:47 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f24cfb8539so12372134e87.3; Tue, 16 May 2023 00:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221166; x=1686813166; 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=xlM3eYv1IZ/hNqJzORarcpDSgFBeHnRSgoVNeCMN0OI=; b=CYF2awqA3QBPqECdXTLxEG95LOlfTJWtn1YpWmrDv19exiCwfnk9p+iVSfFFn4sOEN 2epPa0KICye73idQTg1vSX0IDvHfHxyx1qK7Gnatc1njwlqOiI5Vw+UKeEcC7QM6Fh0d 3G75lwc1QLsBXbqKnxk2kL6NoVMxEPKxFNUGn1QXglTN9H9+ZdAZYLOJ2dBWwX9S+ztv phu2u2xg9TKcDe3Nm9UYDQzeUzhUEc8ycuLElK8kObvyPT4+1qqDJ3IoHzahBoPXz7HG kuhAPHG0q0JrfDl2wCuZK7eHjQ3q/gN3uwIfGBbe1keuI9V3sKdf1bM3QA65rBTsx/52 7Fzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221166; x=1686813166; 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=xlM3eYv1IZ/hNqJzORarcpDSgFBeHnRSgoVNeCMN0OI=; b=RT2PMqGOg0utdShm7E4zXAA5kAqM17w2g52k9fD0KUR4stLg+zC1WtyFqRyQdqEvbh /FXNVQbj7KCfUCKHIxmXXXMGU/2T5a499bqQVg2WEUkey2Yjuog9KxVDiZ2prJXSFVyZ k35e+W5DSN/R1H3tA33j5kNmeY4v2Tr3VIPAmPDpFXClESk93V6r/h41oIsGAN3VGwJf 00PG8oYAp9Sf7lUVDXBk7wQV/J6qDj1H2izYc1X3aQ3i6IuoeXPT2eOg1hwBEKwgbMOS ydkLRts//op3+kaO4vqRm3bKgkIlz6OcGxLHEz48TfpNO6lFz4IpMRiXPKdBXLmOJPq7 +JYQ== X-Gm-Message-State: AC+VfDwYkK3UQyE54aelkILwn1deY6sdFicxWAMtioeloyLc+DqfAdga nB3wQm/tVsLmZEwHOmqvMJ8= X-Google-Smtp-Source: ACHHUZ6RkS7rF6edZ0apiKlbjHNVf9bjjMPUhnGDVprjZtw3VwTQSpDENb2BPjKT4vQkvJQpY1XtNw== X-Received: by 2002:ac2:5197:0:b0:4f1:43b9:a600 with SMTP id u23-20020ac25197000000b004f143b9a600mr7658465lfi.60.1684221165779; Tue, 16 May 2023 00:12:45 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id u25-20020ac243d9000000b004f3892d21a5sm198196lfl.69.2023.05.16.00.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:12:45 -0700 (PDT) Date: Tue, 16 May 2023 10:12:41 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 2/7] iio: mb1232: relax return value check for IRQ get Message-ID: <429804dac3b1ea55dd233d1e2fdf94240e2f2b93.1684220962.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org fwnode_irq_get() was changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen --- 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c index e70cac8240af..2ab3e3fb2bae 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,7 +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) { + if (data->irqnr < 0) { /* usage of interrupt is optional */ data->irqnr = -1; } else { From patchwork Tue May 16 07:12: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: 13242664 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 81162C77B75 for ; Tue, 16 May 2023 07:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbjEPHNV (ORCPT ); Tue, 16 May 2023 03:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbjEPHNO (ORCPT ); Tue, 16 May 2023 03:13:14 -0400 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 78B3126A3; Tue, 16 May 2023 00:13:04 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ac89e6a5a1so136197161fa.0; Tue, 16 May 2023 00:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221183; x=1686813183; 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=AhRTMZbB5GyfBpUyVEuRkkcYJv3zIi1DEzh81ls/BK8=; b=TYX7wKXxpI58eb565F00MA7mXwa1D1rr1TUaKLo0x4WFyBqEZB1lhQPEBlEMN/f3ga 96KR13Ur9kw4oAySC50FCJLbCWkAtJv6yi/1TpbS1Tf3X6ntWSvJNLGJCJ2n1ABJva6G bYhNEUFTfyEDQ2Sx6YkppdBUoUqlIPAS6fb38GzIexU7oSYjF3zU5pvzdTNqV84W/NMH JAURk+Qf3QMT9HE+nRUKib1BFnsUtNa3dLoTANtSdXVhugpn7uDsW1r6AjNX27fU5tMm DR1S5pmmSG/ny1851YrPMRJzWLcfNK/+btOlvdapOm/vm+aSkDVOegWmxjNPb9yPztRa rpFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221183; x=1686813183; 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=AhRTMZbB5GyfBpUyVEuRkkcYJv3zIi1DEzh81ls/BK8=; b=j3jMWNjWABnF41mZWNRzw6e1GL5L2wA64Anf1VwkLRmdP1r7JADRJA1aumNWYLzAv8 uLG3OHENPiQLHN/ZdCPaFGJVZ8yhmehxu4FRZSSSC+Xgh4T+osIdPZeiMW6vZNtfqZMp 9D4g0qyiw+bSMEqbiNHjBwFiZlRl4qivdqEESIGJR1kyIhS6pGObKaUovb4SQzWpeL7m doYEaXhe404D7v4rk004BlkJIggsUg3W7oq95wQDKORsCTYQsuJY0EOSmXqzXq2DIdBZ bZyRD2zqRYMnvEuP5PIjbtFNcNPGi6Ssb9RopYUO0hYxPaEU+L9XKjG0+DFWKta+v7Mh pyYQ== X-Gm-Message-State: AC+VfDzoOdKPM25HoD/NDob43LgjMcebyu8QfQf161m5PGzFs713EIfu 78u/cbwyXVEtqBq7hzlz/js+pq/DPkg= X-Google-Smtp-Source: ACHHUZ41Hf6/H2CoNXoSC/fNvlaQD+g8ZCd1rgZOZqoqvRJsrUfXQ8NdcA/kHiIHwFZbHvdlHL2PsQ== X-Received: by 2002:a2e:4949:0:b0:2ad:9c36:d4aa with SMTP id b9-20020a2e4949000000b002ad9c36d4aamr8163965ljd.17.1684221182519; Tue, 16 May 2023 00:13:02 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id r3-20020a2eb603000000b002a8c1462ecbsm4005891ljn.137.2023.05.16.00.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:13:01 -0700 (PDT) Date: Tue, 16 May 2023 10:12: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" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 3/7] net-next: mb1232: relax return value check for IRQ get Message-ID: <221edfd9824a93f0a775b9588b171d6dae0ef986.1684220962.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 --- 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 Tue May 16 07:13:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242665 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 819E8C77B7F for ; Tue, 16 May 2023 07:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbjEPHNo (ORCPT ); Tue, 16 May 2023 03:13:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbjEPHNh (ORCPT ); Tue, 16 May 2023 03:13:37 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464601BE1; Tue, 16 May 2023 00:13:21 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ac836f4447so140644821fa.2; Tue, 16 May 2023 00:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221199; x=1686813199; 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=5yQG+L+sWAMbAKI7nwRV3Mk7EmEihKSJv4LlESWu6Rc=; b=EJMubyT2VJWX1+LZ4bUsldilZtFa74Xup//IE1hI4TlZKIQfXllceGaKcK0QLVkBIL Y7qxewfxN44AeMrltk4wayz71pVgLc0+e753neV4npsln1uMXL38S0AZT+kDtTYj9qP8 5PIpqb7293xJpKlAEN0Ew/fWXEj94qECrNBK0QKsA8QGmPCJ/4G5PwFk+gvK1duKSHZO mz/+dVg0Zlm0a1ZWDbbEl+EximPAP3Op3iQOYImkKl3PWIyKPc5QrRfsjPdiG0hRQWmN ip2mV35sPoJTj9/NFRK99pq5bV4QfIgMM3Wj7+0fEe86D20GRLqSaVuheN4VpW3lgFvQ 5mDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221199; x=1686813199; 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=5yQG+L+sWAMbAKI7nwRV3Mk7EmEihKSJv4LlESWu6Rc=; b=BvHLQLPnqyqZIOGR7pK9374MFWsVktmiWgsXbSHUP9Xn1VjfDa6gHzecgVqSlAkuPW /uOlktWAIqDSI3JBNAvaq8yT8dsMYVWTFcqXkM/MRESk/J9Q/SUqPxp8ginTDbUC7xcE sIAOMqJMFF/6CAnM1LhVMXomqYVaAPnh/137mFdWtTe42orQECsqocdYbTfx3c5djZ5l 2xw2loxGVD/u2fIQLamSrLE7mN3svP5l6DSt65oXGKo8+h49AHMIfDYAOV1PqrUPdUnQ QlxcX8wHYIoG1Pub/61geXAfaQMMPl/OC8vEQGwK1QXkOHaMk+UXr0sDj/3dHg0ksxMy 5Waw== X-Gm-Message-State: AC+VfDwy9WMSStC55tASEC5kKP1p5xo42RYcuMO4bGpYGONI2r4krMOK LYXQG3pH9WGyOhCx5RMaO5U= X-Google-Smtp-Source: ACHHUZ5TiNy3bPlF9s9syDX3x/nLlKnam1O4n3XDWwbGWRbrFC9CpZ/d33KhANYPsXPIuMpFPrSOVA== X-Received: by 2002:a2e:3511:0:b0:2ad:661b:ac44 with SMTP id z17-20020a2e3511000000b002ad661bac44mr7934095ljz.39.1684221199254; Tue, 16 May 2023 00:13:19 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w9-20020ac25989000000b004db3900da02sm2881066lfn.73.2023.05.16.00.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:13:18 -0700 (PDT) Date: Tue, 16 May 2023 10:13: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" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 4/7] pinctrl: wpcm450: elax return value check for IRQ get Message-ID: <2d89de999a1d142efbd5eb10ff31cca12309e66d.1684220962.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 --- The special handling in this driver was added when fixing a problem where returning zero from fwnode_irq_get[_byname]() was treated as succes yielding zero being used as a valid IRQ by the driver. f4a31facfa80 ("pinctrl: wpcm450: Correct the fwnode_irq_get() return value check") The commit message does not mention if choosing not to abort the probe on device-tree mapping failure (as is done on other errors) was chosen because: a) Abort would have broken some existing setup. b) Because skipping an IRQ on failure is "the right thing to do", or c) because it sounded like a way to minimize risk of breaking something. If the reason is a) - then I'd appreciate receiving some more information and a suggestion how to proceed (if possible). If the reason is b), then it might be best to just skip the IRQ instead of aborting the probe for all errors on IRQ getting. Finally, in case of c), well, by acking this change you will now accept the risk :) 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 Tue May 16 07:13:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242666 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 30390C77B7F for ; Tue, 16 May 2023 07:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231175AbjEPHOG (ORCPT ); Tue, 16 May 2023 03:14:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbjEPHN5 (ORCPT ); Tue, 16 May 2023 03:13:57 -0400 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 86EF146A2; Tue, 16 May 2023 00:13:38 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so12907383e87.2; Tue, 16 May 2023 00:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221217; x=1686813217; 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=Q84i2H2s0iKoSUbGo2nOM5QzhVg2YGGG+qJiK8DxGzU=; b=LKQGxdUUyHhjZqUUxJBsN/HPYW7jSKRkZBQj+iHOApcRlxNZBtaPmkOW2agWLD/xKK pbwhx1xEMlP7mmRl4HmoMcNwl4YeQ84y8I3h0u5OyXOQPRC4EvXU9mLPNK9Qh68X/l+k lALMwNrBVPjZMurTddrdccvIpl3aT+vu8/w3Oly1QufkC+JLYWjis+n1RJwXon0xkIxW n7OLGnj3P5J6YGK0h56ff3GaNwCMjt+vK4rSGv2BjLT9dcjbZK0qY0mPMYMI4MpicXAa 3k5VECX0KJo8ApCtCG0CcyyXiyxNJK770yTIhjLGDfcXjTG/+2P2Lkn7ooQz9gRlEzlu n30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221217; x=1686813217; 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=Q84i2H2s0iKoSUbGo2nOM5QzhVg2YGGG+qJiK8DxGzU=; b=l+9gQD3dp33bKydoiJ+7jAgyxXYuf3GH3KOjFGqH4j8eusRiHOI6eBOpCmXsNLzlrq XJk0TdUlDQI9GtNcFkYJoF3tkgks3bJV8GqLOWN67PCl/XxGbxAhSMrxb+qcGflqSH6/ fS1EwuV7CiUHiiEdTh4BOneoCkmvdb34yH8JBA7attomEGmUvybyPJOgof4Ps3aAi1Wq uJZCwF1sss5u3QteFClD0nCQNDv8R+LzdTskwqzeXJrY/z6oZTZAHJcEhYZo1V/KMuH1 DwZkuQqIyKyR8cdx4Xyt7FoiD99M8YkybgoUxHZKCQw8gkHoLu67kjDmsj61ejMMohx9 SfzQ== X-Gm-Message-State: AC+VfDxZNzPIhEmVRL3Iv1SIB5YaVk5AQdK3NY6GyQCPqqUWy8Npyajp UkdVW5WQyQZAZm+1qXGAZgk= X-Google-Smtp-Source: ACHHUZ7fIJMrkIh0IZ97adzWW9Rxn5SvLMT6faWlFwiAf9tq/V47SXiAfpEoQl7fpqXqpx8xg17QJQ== X-Received: by 2002:ac2:446b:0:b0:4ef:b18c:89b2 with SMTP id y11-20020ac2446b000000b004efb18c89b2mr8583772lfl.56.1684221216672; Tue, 16 May 2023 00:13:36 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id n7-20020ac24907000000b004f389c98aedsm164151lfi.201.2023.05.16.00.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:13:36 -0700 (PDT) Date: Tue, 16 May 2023 10:13:32 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 5/7] pinctrl: ingenic: relax return value check for IRQ get Message-ID: <17d04e9b7d76fbc0804dde8e1c4a429d7f19de80.1684220962.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 --- 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 Tue May 16 07:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242667 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 435D7C77B7F for ; Tue, 16 May 2023 07:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbjEPHOb (ORCPT ); Tue, 16 May 2023 03:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231218AbjEPHOP (ORCPT ); Tue, 16 May 2023 03:14:15 -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 EC4E744AB; Tue, 16 May 2023 00:13:57 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so12907697e87.2; Tue, 16 May 2023 00:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221236; x=1686813236; 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=x7iB2tT1FxzgZOFKdB6YdWc9HUsfJ2gQmhK2D8CH7ls=; b=F2Ois8vAySQr2U0tMK8uXNP/3vsb8HWxhd6w6T0u9tyJsJpG2pIF8ViQo9DfDpnfH+ ud43j7l2z7rT6LClB56VEbDxtWMpj0tcryVQkZ5bW3jPDZ9XtjLm2zMJKzgSRXehqADn ZnEgO9Z+BM4QphonC175O9hzG6X7T9769/kCCc/a3/EKDaSroyAYfT7VEsbgljBN/bf7 hbxb8Gn+FzJlB1r/Zc34QqxR4IKfKRwlZguJ6CWaoCayKTOhwxDHOIWrNuukamJVUny3 D3GG72MhfJvJV0OCp3SKi4vMdk1qI3SqJ9EiF8vNLYStQoXy8OtLLBqv2lH9MpU1wRVD U7HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221236; x=1686813236; 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=x7iB2tT1FxzgZOFKdB6YdWc9HUsfJ2gQmhK2D8CH7ls=; b=fAlhPHwhRZHoo0Fjtxqhg4G5CR4+1F9vyR2x4PU6KVQez7B0lIrpZ129YKDjtrGAHm 5UMV6sx5wX+tMB9vpltvR+lCghWApvC0xhrTYJh51wUUIlAmVlDNxzvWWlqBUCDBXNv5 8QnycWiIR3y3hEUciCuZyn4FCSXYs8QSzV8ALOrOQ33d+Q+qlrTWCWSlkJsqkFETuKyl GcSPu7+LzmEUBxjWvPYBxAqqr3agZ6ShJM3RmInOdr+HAUliuR2Vo3e0+j34yxM+KznM OAg8sLYJpDHdkwv/L83QczksgpN28cleDTNoM2VamfAG9oQpI8AJRPnAr/DWhsLAi1C2 3bSg== X-Gm-Message-State: AC+VfDzY3njR/aQYBtt8IweGEXbCy587EkFWd3mw+kNH9DNlbOnXngOz qWnk4BWdoX249kKKkIHsBJE= X-Google-Smtp-Source: ACHHUZ7mcAh05jssI9gTt04ul3aPVER3NAMZdK2vv5y3BfBFTtQFfWIVyeOwl11u37jMcbM3dX4Rrw== X-Received: by 2002:a05:6512:20e:b0:4f2:7b65:baf1 with SMTP id a14-20020a056512020e00b004f27b65baf1mr3635981lfo.23.1684221235879; Tue, 16 May 2023 00:13:55 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id c17-20020ac244b1000000b004f13eff5375sm2847608lfm.45.2023.05.16.00.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:13:55 -0700 (PDT) Date: Tue, 16 May 2023 10:13:50 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 6/7] pinctrl: pistachio: 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-acpi@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 --- 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 Tue May 16 07:14:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13242678 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 30EEBC7EE24 for ; Tue, 16 May 2023 07:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231204AbjEPHPF (ORCPT ); Tue, 16 May 2023 03:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjEPHOk (ORCPT ); Tue, 16 May 2023 03:14:40 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854B23C3D; Tue, 16 May 2023 00:14:17 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so12908068e87.2; Tue, 16 May 2023 00:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684221256; x=1686813256; 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=bBg0Mv9yvZiy6gYM1yujQ0ayIWUjiANXlVQil+oRP9Y=; b=E6/E0+MEEZ1V/BLo6RWxpKoRFfZ5rkKw7MEVSwmdLGV2YtTugh6RLL2JwsEvv33dM5 ClAwf7nx4vMYQFP/7MhVwN9krtGpdVcMhlTzD+WxhCtwj4QgM/F3GcoPnQWSxi8LWGbx 9cEwrV0sKZVvM0yg/DTClauC7F3/0jP+g4f7wBC+rpg7g6I5e4sPzoCkkE0QlkS5dfv7 ZGw+aT4+k3lFWsFGifek2Og/IMTTArPni0CoftZbKkHMOh9COZoT6OmsJiqqSQxZDBjd xOIGwnaMbePP50iMnTkjUVJX2eQC6AecG2TcFE5OH+yANztuBHPh6mOS4mCqriOj+ldE wHaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221256; x=1686813256; 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=bBg0Mv9yvZiy6gYM1yujQ0ayIWUjiANXlVQil+oRP9Y=; b=DgrmR/cLOZlZZyZaR9cF7Hso+8eeo3+NxIPdA58qdE28z79JM6AqXnawXiSt0ZAttz +o+WPvC6EmqX2bC9u4XeIlJuVq9/BYb/1Tr4j2X/GMOzp9y7Y0XLMXq+bRoViCwjii4X GQFXGZGPEYW2RtIR34wzk/Saz7Mzqs5WIXDJvnFMQfsPk9GGTx2r71KBStc0cePnDY4T +RXenlNltEgvsp/9U2qu4hdgm3xp5gW3WvsYxqf0hxuIA/E5YA03L/3ExiPsf6jFEfas K/zx4rW0kgkejzy6cXZhrhpmLsifU1mSGBnuMywVzLzFZIE9d3TFdujoVEGbK6gzL+9u IHEw== X-Gm-Message-State: AC+VfDycPlYR9KGwbIsufNml8+3jrG7hIdUwtojqtQruupJgRm1Gt1rp TFqzqyL7fozhZZo99TAx9Z8= X-Google-Smtp-Source: ACHHUZ49uNR3NJnq5Gt3aNGxblrfIAs3JelfkYNAqlgvXUmiEjle/AtjF7IeH2JaJf2x8K0OPFI9rQ== X-Received: by 2002:ac2:446b:0:b0:4ef:b18c:89b2 with SMTP id y11-20020ac2446b000000b004efb18c89b2mr8584496lfl.56.1684221255593; Tue, 16 May 2023 00:14:15 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id o4-20020ac24944000000b004eeda2caa3fsm2864092lfi.55.2023.05.16.00.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 00:14:14 -0700 (PDT) Date: Tue, 16 May 2023 10:14:10 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@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 v4 7/7] iio: cdc: ad7150: Functional change Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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. Signed-off-by: Matti Vaittinen --- 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. I did this patch with minimal code changes - but a question is if we should really jump into the else branch below on all IRQ getting errors? } else { indio_dev->info = &ad7150_info_no_irq; switch (id->driver_data) { case AD7150: indio_dev->channels = ad7150_channels_no_irq; indio_dev->num_channels = ARRAY_SIZE(ad7150_channels_no_irq); break; case AD7151: indio_dev->channels = ad7151_channels_no_irq; indio_dev->num_channels = ARRAY_SIZE(ad7151_channels_no_irq); break; default: return -EINVAL; } Why do we have special handling for !chip->interrupts[0] while other errors on getting the fwnode_irq_get(dev_fwnode(&client->dev), 0); will abort the probe? 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c index 79aeb0aaea67..d7ba50b9780d 100644 --- a/drivers/iio/cdc/ad7150.c +++ b/drivers/iio/cdc/ad7150.c @@ -567,8 +567,7 @@ static int ad7150_probe(struct i2c_client *client) if (chip->interrupts[1] < 0) return chip->interrupts[1]; } - if (chip->interrupts[0] && - (id->driver_data == AD7151 || chip->interrupts[1])) { + if (id->driver_data == AD7151 || chip->interrupts[1]) { irq_set_status_flags(chip->interrupts[0], IRQ_NOAUTOEN); ret = devm_request_threaded_irq(&client->dev, chip->interrupts[0],