From patchwork Fri May 19 11:00:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 683964 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 0ABFAC77B7A for ; Fri, 19 May 2023 11:01:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbjESLBr (ORCPT ); Fri, 19 May 2023 07:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbjESLBp (ORCPT ); Fri, 19 May 2023 07:01:45 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3616D1BE2; Fri, 19 May 2023 04:01:12 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ad9f2926adso34391261fa.1; Fri, 19 May 2023 04:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494060; x=1687086060; 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=oY1HYSQizqf++ddJ9pIAfIcp1VHkJcel6jxA5ixO9Ds=; b=IDpkDXNP+kZGUOjDbquAIu8yEdEqWAlhJ7BycF2yRZK0PX+d1qr9Z/GhnVwsxqGoVb nT4fuXwMGtQLMGkczH4zGgyQHbw4t0ABMJR9gLLF9DaHv9j9huaLkHkE3Ha2oIMY/KIv 4RqFwJ1cDMjVv6uppJLKmCOn8XaCzufgu64VGOlW5j8UM1niBuZ6oHk9JCuCOXOS/vrE BtA0u7mgRzltM8XiVpvFbg+dOZCAjVDrtQ/XEgVKII8GYwW01/PfkmjCNWBZxAUHQCyi u9vKF5eIUHdVu5K5nvKmNpoNpHT7C8ub4tWDFbSD/xWQDdoLP7swIolp4H6h9tPYFb92 PDsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494060; x=1687086060; 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=oY1HYSQizqf++ddJ9pIAfIcp1VHkJcel6jxA5ixO9Ds=; b=CedA2cBco53eUQNfVhQlLA0lhJT2eszU5wQZsF9M2TZIDBN/18WTgmykbiUvdPqzaE CXf9ts5z3W9sCYIqVr1kZMBMzQTy7Dj4hurQT70PebRN20q6ZOx/KFF9OOPUB3Na3MDD O6wTDvgE1r/EZCldcS8QC5IkR8RgZCiRUsuEaDUeZHW6b8R8qZRspILNRh7mkN7lHbUi Ut1vOdlcuSylRYj3MQhxWfpL5oaBQxogXhiiYCaPyfayeTXP8N8i9lFDJNR4UYggKd7Y 6pxLQialGCGpwR241aBOHMLnUsunxzfK+7Iy3egj1CLAFgMz8oy06iyT+EzSxfAWHhRU uGXQ== X-Gm-Message-State: AC+VfDyryOtf1tWLooEG/+VrTQtQHbiqjc5uSE8ngn36/v1eKyFZ7qIQ b6FMq5t30mkI0vwPd3OLaWY/nIN0iVo= X-Google-Smtp-Source: ACHHUZ4Yb8yh3iwvBtOkG3lkvyDjcH3Ey0hvO6TIGUNMT5QvdUafoy8WA1B2PrgGV5c4duioNIo9nQ== X-Received: by 2002:ac2:547c:0:b0:4f0:1e7d:f897 with SMTP id e28-20020ac2547c000000b004f01e7df897mr768560lfn.17.1684494060124; Fri, 19 May 2023 04:01:00 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id o6-20020ac24346000000b004f251cf3d31sm558454lfl.153.2023.05.19.04.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:00:59 -0700 (PDT) Date: Fri, 19 May 2023 14:00:54 +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 v5 1/8] drivers: fwnode: fix fwnode_irq_get[_byname]() Message-ID: <339cc23ccae4580d5551cc2b6b9b4afdde48f25e.1684493615.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 Reviewed-by: Andy Shevchenko --- 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 Fri May 19 11:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 684753 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 F3EC5C77B7F for ; Fri, 19 May 2023 11:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbjESLCI (ORCPT ); Fri, 19 May 2023 07:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231852AbjESLCD (ORCPT ); Fri, 19 May 2023 07:02:03 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE0510E9; Fri, 19 May 2023 04:01:30 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f25d79f6bfso3623761e87.2; Fri, 19 May 2023 04:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494088; x=1687086088; 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=3uZYfx3hyEjD6ZwDLsclbF5cJ3UWQoHkrfkUlHvER1Q=; b=Z6kLA7vTKbxFSDOMqZKgtyNJf/K2T5B6giEMZkKi7A4J0oLrNav4PeYS1WrKXy8SJK 78XRFMmBmcI6AfiG4WmThsz/ljFdM3PcKHxxjEKWZD8WoeFyrIExnwp59JbxjgtPIWnx vbVdkQJibk+praCD00yW32Q76wblErU9g3SqL64WJjcQJbZQH7J5fgQJTAzU68jq+UwS YbueoxSZ5Adug0+7+tqsfTweR9LyvKnkh60sJnITM1oa3/kSyZoTgredrWBvVia/B2Mn Z60SuEbq0S+LB+86MtQHY7NjiK6X9T1+2ointvwW/tJvkM4SSz6gykNxIbyniPJPblge XEjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494088; x=1687086088; 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=3uZYfx3hyEjD6ZwDLsclbF5cJ3UWQoHkrfkUlHvER1Q=; b=AincygZoWEAIKdMxuN+WZYowsy3Md5AZSSHnBkSp5+258B6i9YmWMt+NBA32onbWHY X/sgrommy+MxzfzYHPAQilt3GrMfESHM1gQtb4FYMa6B2Pv97mBAGzT0AwerAgRuz0Aw /OKDBtapSF3Z9gdT6+4m8QSWXfWrhw4ivTfLeWSWJ9Bkw/1SGQrqcofT2hGScU4wgE/S pHN4xEKHxO4ozcM0r9LRzYxXRwf42aF+YgFJdOkKQp9kB4pgjFXfLFuK+KSH7KHLi96F Ey4KsHcbwX7WIbzlXk4C3Qd7bx5MBg/T5fKvBLI+hYWM8v7lU2kCXqXj/zaC2V9zK72B 8Pqw== X-Gm-Message-State: AC+VfDwhS1oVXiOscdMOe6d3SZ30ct4kAEwzqTGparxzmx+79JyCZxfc 1seyO+UZ7AQus4oXv6v5QDQ= X-Google-Smtp-Source: ACHHUZ6+keknVQA72YsdN5ExkPnf5lEpWalgfq0ryHX5h2KQYWZbvJIuX2pBx99C5haGKbUWtIfiqg== X-Received: by 2002:ac2:484a:0:b0:4d5:a689:7f9d with SMTP id 10-20020ac2484a000000b004d5a6897f9dmr708885lfy.57.1684494088176; Fri, 19 May 2023 04:01:28 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id 12-20020ac2482c000000b004f1288434easm554827lft.292.2023.05.19.04.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:01:27 -0700 (PDT) Date: Fri, 19 May 2023 14:01: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 v5 2/8] iio: mb1232: relax return value check for IRQ get Message-ID: <05636b651b9a3b13aa3a3b7d3faa00f2a8de6bca.1684493615.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 --- Revsion history: 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 19 11:01:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 683963 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 7E594C7EE26 for ; Fri, 19 May 2023 11:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbjESLCj (ORCPT ); Fri, 19 May 2023 07:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbjESLC1 (ORCPT ); Fri, 19 May 2023 07:02:27 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929231BD3; Fri, 19 May 2023 04:01:54 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ac8d9399d5so35396641fa.1; Fri, 19 May 2023 04:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494112; x=1687086112; 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=gkYB7W6EIjjzbGiSlqrEyzRmwdHttot0sA2nFcKs42o=; b=QkXBm0Yk/lsHk/RhV+I75xdBWJGHX+o1sOXTZd1AE9T2+qFXzhgjPZuQ7kli5NiBW5 nTJExjZjzmJmqGJkckwbcM8IU3WXvjSPnCzecWe3JB1XkVfq1pep2IU9SXa8SzifXNbY oGq3UTLs/4lfkGk9Fwv5k71YZUZ+VmuHYiID1Mrd3mFW5Ipxs3Sb1LgDJazQL3eZWfzz XOZmPUYpITfLiamdhxXDdYy2RfIrP2gyI5WbftXnJD1wxG0M69saZfq8lhu6q6K26x69 TXxXtmT4ilVB7/Dxb82w8EszbWQ4WMMlGmE5lArO3Ydrv26RbariaJTkKyeCkYwMxI1p Cikg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494112; x=1687086112; 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=gkYB7W6EIjjzbGiSlqrEyzRmwdHttot0sA2nFcKs42o=; b=YZ3M9zcx5mkian6KYcGUZsOxUNRs58zlna+mxHG55XrXU6AYpI5Acp7BvrfcfdaHCG fV0s+OUiuzTPEou8rIKIzvS3vZqu7BU7S/1FKHx3mQ0j8zkDs4vM9YqCPmpjoniYfBIz tEzF1+yHcXR2y3zdRCOZEnmmuVyYtrukGO2NHAxpobhCnxt0mL2D9Yu4zqBnc8Pf5l+6 LgHbMYylavUSotcyAJc4eZOqL9SbG+YYw3HyB2xSsDYZy7PnAAKH4pLEGjGwjyUz5DZb 5TBejGg3pqWVayANucdhMlzYtRX+Rwji4saaoF2Vup5wFcl1PqFOlHQzVaZbMRkwEffG nMZQ== X-Gm-Message-State: AC+VfDwnL9YUN8E6gOzHV3VG0nRlAkVYALFfogvMomImXVDzgDVA10yZ 3IsUnjWgbYylXDYyjnz7cJA= X-Google-Smtp-Source: ACHHUZ5/q+zvMZ+zbg+FKIFk8D5PZvwdxgUr+VEmpWVeklatgBfB34pR/1qPtDrg7FlFnAHRjW/Flg== X-Received: by 2002:ac2:4a84:0:b0:4f3:8507:d90d with SMTP id l4-20020ac24a84000000b004f38507d90dmr563473lfp.34.1684494112221; Fri, 19 May 2023 04:01:52 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id s11-20020ac25feb000000b004f122a378d4sm560346lfg.163.2023.05.19.04.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:01:51 -0700 (PDT) Date: Fri, 19 May 2023 14:01:47 +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 v5 3/8] net-next: mvpp2: relax return value check for IRQ get Message-ID: <7c7b1a123d6d5c15c8b37754f1f0c4bd1cad5a01.1684493615.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 --- Revision history: 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 19 11:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 684752 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 DE75EC7EE23 for ; Fri, 19 May 2023 11:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231851AbjESLC4 (ORCPT ); Fri, 19 May 2023 07:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231860AbjESLCw (ORCPT ); Fri, 19 May 2023 07:02:52 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607ED19A2; Fri, 19 May 2023 04:02:24 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f380cd1019so3693982e87.1; Fri, 19 May 2023 04:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494141; x=1687086141; 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=HD7sDwjeUOhS/tu28skRBlZAs5C/+PALR8fkv0T+X84=; b=eijdIr5oXQZZmSbxyQ5q0NXx2PiSz0Y09n80SbfjV6RR0BJjjGnX9dwRUoI9cGDv/S orxI5273zbZm7bxK8XZsIYq+OE2D6VvfnWy5gWdoK260mX9rBg3jVliyZGFA1yugDcPc GRTRDwTBpUTLw659W1HUwZFgbOo+cQM30qgDnjWpRSMXN/5Alsf9p9DR32gimXgBn495 /t4ojKTj1N7EmvnIcR9GaL0Rd6DUtrRkX7+mIGnGL0Px4JJqWRCGWiL6QDhQrpo0UQH6 vHxJ+OMbjN8ONP92A0pNoVP4oa5ljVr4nJbm5A6B0R/nJg/r8z0n6Rasb55WSewYob/L Oixw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494141; x=1687086141; 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=HD7sDwjeUOhS/tu28skRBlZAs5C/+PALR8fkv0T+X84=; b=Zmz4n5cTJGAeqp3DcsxMusso3EMvXRqsbET1Hq9pdu5FZacZSGmHLVv5+9KosDWhxf HIArvJM18WbbsJEycMObEoZM9AuDUYoks88TMCuWo1qNQQSnyHRk3e+YDUth43o3B/DY JvBkDQ4HhgsAbB/BRe5nc0BcMY44e0ialOwMT566RAsIF4g1RqKj0JhCSlwiuEIMMclE 1cwNcYb0rURw+YRYLj4GfbEmE16PzLZy8hilqJDQbSgx7KBT7/EbeI57+Onnk0tMMA1G OdcrOQ+2eSoXRZbo+BLO5nnWh5czoMOw84E+1ovGYJbgns/vmTnN1A66vJRR4BEIK8pX 8pcA== X-Gm-Message-State: AC+VfDz0IJF80vuGBzf5JyoBTWtYiiMXw1kuDrx9RvaOc/rALYYPzhHg hEB5GmdA4mgWJdKiEjgqhcw= X-Google-Smtp-Source: ACHHUZ6u5g5R8jfey5qLxBfEbsi2trlh8URnopv6VaDE/U0+UiFkYXbLz0B5+gbKR7EvGEJQp57gEQ== X-Received: by 2002:ac2:4949:0:b0:4ec:8e7e:46f1 with SMTP id o9-20020ac24949000000b004ec8e7e46f1mr685248lfi.66.1684494141204; Fri, 19 May 2023 04:02:21 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id c12-20020ac2530c000000b004f387d97dafsm565093lfh.147.2023.05.19.04.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:02:20 -0700 (PDT) Date: Fri, 19 May 2023 14:02:16 +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 v5 4/8] pinctrl: wpcm450: relax return value check for IRQ get Message-ID: <42264f1b12a91e415ffa47ff9adb53f02a6aa3ea.1684493615.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 Acked-by: Linus Walleij --- Revision history: 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 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 Fri May 19 11:02:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 683962 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 BEB2FC7EE26 for ; Fri, 19 May 2023 11:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbjESLDW (ORCPT ); Fri, 19 May 2023 07:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbjESLDO (ORCPT ); Fri, 19 May 2023 07:03:14 -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 A26C91BD7; Fri, 19 May 2023 04:02:42 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ad89c7a84fso34340241fa.2; Fri, 19 May 2023 04:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494159; x=1687086159; 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=LfIfZkT5to0ygfty53KLXwdW4k+vS796D0eoWkZMOFE=; b=cJWVxCMNdCYmWdaRTtqzSknn8+g3xOPc15ifl9Di+TNaCKKjPV/u1S0oQdvFCl9Dsw Fm0NVDqXXP7zuI4XQd2Sk2lIhiTRCtS87HrCd/NcmtBEuneWoH/Xu8TkaN2Fj4irfD2i HZ98uf1CT0ubdZ13eS6BFDdcAG1MNPFyH/rZdlyBhI+NhZES5+at3A7xNGtPNSRVSSBC BG9fa5I7UiupejrHkAdkm9bJ9qeze4GavtP0PSgDfqP5GXdLGUcq0rlaEZFkcyRvn28e jjTdS5VG6cx9AaWBZUuM8vloMCrCs8zbYMo8caIv0uXbrYYIwya18lUnQDN/9I7981XZ ZbXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494159; x=1687086159; 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=LfIfZkT5to0ygfty53KLXwdW4k+vS796D0eoWkZMOFE=; b=Po8dL2clV/EZYzqdasyrsay2tLj264IQT+1OxXF4rSdiBAQ6UKtlajIWn+AFdAVgMV 56LjUIjmInOxgc6x98M+9PmJGhe6B27VgMUnG9wMyM7hgdBxfy/y/vuQ6JrYgeBqGr+m jgP51pYXKe+dkXFramFQRYOXfbZsilQrBd89ElPYkASE3PAEDwuFpgoOqwg8QhTKXjY7 zPtcgDhzclBYfcC9V7Bib4HX9zV+X7vFLB/yKxBSXbEPqvu1Kw93e96y0kNJWZuK9RZ1 1d7XxDSPcnMWaYTpAiIZLkfz/EgkbeLUvg2XTqCAg9rzmI3aKtBKkviex4TtbcHnNx6b vMBg== X-Gm-Message-State: AC+VfDwNbMxIwPyZVO0m3wB263pk/YEtOpanhfuuPtNjPCkIwT0pdF9A CZTq+ODoIq8iRrMc1EErAVg= X-Google-Smtp-Source: ACHHUZ7kLQeM3iKsF59w4UnthlNctv6NledR+bbcU9FAxUkJ7v3813sVzksg2947S56c4oWmPuLz4w== X-Received: by 2002:a2e:964f:0:b0:2a8:a5b7:6057 with SMTP id z15-20020a2e964f000000b002a8a5b76057mr595196ljh.50.1684494159371; Fri, 19 May 2023 04:02:39 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id u10-20020ac248aa000000b004e887fd71acsm556763lfg.236.2023.05.19.04.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:02:38 -0700 (PDT) Date: Fri, 19 May 2023 14:02:34 +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 v5 5/8] pinctrl: ingenic: relax return value check for IRQ get Message-ID: <9d1eae2a73143188a0b9664c1598948ccad23855.1684493615.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 Acked-by: Linus Walleij --- 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 19 11:02: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: 684751 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 4B026C7EE2D for ; Fri, 19 May 2023 11:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbjESLDk (ORCPT ); Fri, 19 May 2023 07:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231967AbjESLDe (ORCPT ); Fri, 19 May 2023 07:03:34 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B38621987; Fri, 19 May 2023 04:03:03 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2af290cf9b7so870901fa.3; Fri, 19 May 2023 04:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494180; x=1687086180; 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=sK2xLHjcRHLrAnodiL9Mcc2q7WIuVpBASOZhsxiKp2o=; b=bzrHSZustUkWunhpAmaCubObV3Vl6sxXAKkjy8GT3sbSBohJu6G5LcyeMXvRtAjdjx rmn4QrEb4YMfEyjpcyORajQmdpBbfV49BLyrD60hQ6RM9owJRCHaDMXifAjUpynxfOWI YtLdsWoUDt/YINJPKSd5TyNAl4xexJvlw2DfdeeRfMLovDHk5awMIkbOqouBE18ftQuJ /PyTtWQGCHvLtUWWJ+vL8kUKm8SjjIHWTymekaDOl4jAFbGgAFnEId61rdYFcNlGnd/8 xBU/hwdJ0/hYXu2zwaTL7qrf6OKxOA1873UUpnmnWLs/lxX5oMK3dgCliCM8f9OBDYZv 6YbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494180; x=1687086180; 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=sK2xLHjcRHLrAnodiL9Mcc2q7WIuVpBASOZhsxiKp2o=; b=TUo8MZGNxuHo5hnmlSXLr3x2fbZrjlZM+O3dZ3UrFVVIt08UKd39Cw40ulM6xvrHjg aTB0jgIlm8hU1UKQeqnDf2YkjGgBeQh9BFpKAicjX3p5LO3GL/EB4vCsjsj6Sy7Kk9fx 72hPYWngJz6rqXCZQoxWY4DGctzmb4tUihjMUXcy8j7tOTOluRm0DhaOZ7Miz7aYF8NF lhKncV9N+ErCYQC614KE0FjGXofM/lBaz/S+kt683XCr8jZnl8Ho3I6Hj7C83JRpUwKM 9l1i3D270zhxX7NY14ycR9FCFadR8sDDWcM3nE0TTjdCUNbMquNaHpl8JMEqYq2WE5OJ 49Zw== X-Gm-Message-State: AC+VfDx/ZkR5uYjPx0CCyHU0At/Fe9oIuTq7zbBzlNkA0RWlh0tJYfAV RFOZsOkUKB2cCBr6i6zRauw= X-Google-Smtp-Source: ACHHUZ5chLqQVl/sJRSoXh8LQwArbENYGHlmyooCeukzCHPICy04tGwa9LnbVEMDxFXKYQejNic/uw== X-Received: by 2002:a2e:96cd:0:b0:2af:22a0:81ec with SMTP id d13-20020a2e96cd000000b002af22a081ecmr729672ljj.27.1684494180206; Fri, 19 May 2023 04:03:00 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id u22-20020a2e91d6000000b002a8c3ca2541sm776405ljg.121.2023.05.19.04.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:02:59 -0700 (PDT) Date: Fri, 19 May 2023 14:02: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 v5 6/8] pinctrl: pistachio: relax return value check for IRQ get Message-ID: <5d74bdf2ef8738aec0b419392b8d0f38a1b0728b.1684493615.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 Acked-by: Linus Walleij --- 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 19 11:04: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: 683961 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 57ED4C77B7A for ; Fri, 19 May 2023 11:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbjESLFO (ORCPT ); Fri, 19 May 2023 07:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbjESLFM (ORCPT ); Fri, 19 May 2023 07:05:12 -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 D2C471989; Fri, 19 May 2023 04:04:51 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f37b860173so3472773e87.2; Fri, 19 May 2023 04:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494288; x=1687086288; 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=4GNHUsSQZ7XOoZjUlNt5CHQChxGAHRFnKC6pLJgQnQ0=; b=D0X5HOiVrJHBnxegjwyw/Nwh7o5gPNfAfErjqsfy5ahtnMEqu5oZqONT/g8kr/rQyJ rj3EWCKKu0TiHK2CKBLACXgC8HUnAeLSJfIt/E+mVJ1oelJAfkqzNRep/6Jfbo1+Of+g y3yTKfiYAe+KbwfvI/2B1kvH+QN6uIViVwUJ4crxuHrpf1Sz3l4rJZxtjysdLx721hr0 IibNnCsGQfZ1NNYhdu+dg7tn2JAA0HCMzzXixZReXUhyEVge93GaEenwv22FszQPNdwJ F5exYECbCaxHwXFwQ3epapOAJzKJZBLsy2caGUMjrUfxDkojkLVl5rubkARn7tXGt7/e fYWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494288; x=1687086288; 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=4GNHUsSQZ7XOoZjUlNt5CHQChxGAHRFnKC6pLJgQnQ0=; b=feFUbsCKK9ubzjoWuu4rIJWB2BhN/jgKHauxoynLIwkYVhxSXyEImFwehvYQ0vOp1A q3l0TJwDHsoTH3wZuOWS/XFpaPtbd7nwPgJ/olXbCFcvcHFHQ6LGzJh3cjXleUBUbAoW K0BGLferdur6tGxUP1yKqcA60wailFJhJiniN7G+kzrzwULKLYUJ5+71OliLPq73zkIS k/outzQa28UQEQ5Na2HS4SEfHAN5eftUvjLXPcvDFbmGWmKLYb3zlBeSKfLbpS272j+B LgwgxcrqUO0Ofe3UsyZkgYKdkGO+SFow9lAh+UXb/l7OCurfLc4ylvIL1q6NnzvNXpSP 1xIg== X-Gm-Message-State: AC+VfDwn5JOE7ecbqJjZbU0Kiyvw8oac5aVIH3NMgeROMThclIhoFBcb 5Selx/bo5h7lCEpe0mJ3wWI= X-Google-Smtp-Source: ACHHUZ6UTSaftFeK3PA13GKVCxEp/y7Yw4bieoWTl+HfrNQijtyPdtc4WLzKvYG93aZ4rATGZFoGkw== X-Received: by 2002:ac2:5dd7:0:b0:4ec:8245:3986 with SMTP id x23-20020ac25dd7000000b004ec82453986mr744208lfq.14.1684494288048; Fri, 19 May 2023 04:04:48 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id i13-20020a056512006d00b004ece331c830sm557641lfo.206.2023.05.19.04.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:04:47 -0700 (PDT) Date: Fri, 19 May 2023 14:04: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" , 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 v5 7/8] iio: cdc: ad7150: relax return value check for IRQ get Message-ID: <73c633ccab80bdfaa1adf6ae099cfc9d365be6a2.1684493615.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 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], From patchwork Fri May 19 11:05:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 684750 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 002B4C77B7A for ; Fri, 19 May 2023 11:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbjESLFo (ORCPT ); Fri, 19 May 2023 07:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232014AbjESLFl (ORCPT ); Fri, 19 May 2023 07:05:41 -0400 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 5D3EF1703; Fri, 19 May 2023 04:05:11 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f3a9ad31dbso1476735e87.0; Fri, 19 May 2023 04:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494309; x=1687086309; 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=P378hHq4N3JMZZ8BxEOLVTa4riUu6d9EihNhy7E+0is=; b=k+2XNk0HnwQQAxOVF60+teE75k+Oj1fbP4St1f+fNi9cPlQvvAa1J7TqhcjTWlzH/g XG9ZHc1K25RU1Z2jAthkQxW32TOA0r0VKqB1R89ErydtnGmfn1TwEiZmV84AHJ4K7DDc wDGeF2AbWDX48vdZX0bmD3m5F/rdbWLfNAsLwQIE56SwX6i0RFbx2zs+UZZz1SFuh38/ fr+3saVisOrzNYmRaH3U0PKy2k77E7lSo8NzJDVVLlMroZh6e+45Kq3T8BGhgLV4Grqd unY54kOrYcw1BRKjB2RlBovdHKyduBMVCznG7mi6Qb+1J/v8m4Xh7uVYgo8PUBejE2FS VB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494309; x=1687086309; 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=P378hHq4N3JMZZ8BxEOLVTa4riUu6d9EihNhy7E+0is=; b=TtpmUWK+DSteo2P2n32nSQusc6dm0DzsQc/Zq+Aq0pLKw6bIsPfDTI9P5U78XHGOFo I7t8V7whfBZ5mg+S25SQaxzqiIGHFYEu3YMyvRYXVqnh+p7qRnmSKYr2fGMefpWOU6y0 JluA2A4OxR0rJh/hhzAmWdMdxCo/xHlMKsZeOAmTODfn+F6BeU7EHLmfEwC5y9YgRUXZ u9SEpmDH5lf1IJO8y8rpRSoGrligczf9a9jEuFSAiFw6pJlhWTRVa0XPMfsucVw75tCi NUB2pkRmfFCwbjfgyGIrm7SSkx4uJTbe31S2wY8OTEt7LlYs2Gqg+HSAs1YZkT4ZifHe dx5Q== X-Gm-Message-State: AC+VfDxqnvzhcKYursM4JGiUdFvLSx4RUNKqesDxKHNEbD2fIte5KBJa 5tkf/R+gRGNlMBEXrkRoo7s= X-Google-Smtp-Source: ACHHUZ6P69UimKvAR1WNjNClNfxFP7Z3tLtNF+uAexpUlXkKrWsld8MAHgH7DY6ZI/YaQFwkfC3AQA== X-Received: by 2002:ac2:4f8a:0:b0:4ec:8853:136 with SMTP id z10-20020ac24f8a000000b004ec88530136mr648825lfs.12.1684494309113; Fri, 19 May 2023 04:05:09 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id y3-20020a2e7d03000000b002ad988efd73sm783732ljc.14.2023.05.19.04.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:05:08 -0700 (PDT) Date: Fri, 19 May 2023 14:05:04 +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 v5 8/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix 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 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 --- Revision history: 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; }