Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2321647rwd; Fri, 19 May 2023 04:18:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mXFLk0uWrkcbkElxXI09kp2bT7NB/zHzk/eP2g9XMaEQxpcBUxINR3krgBiD+8JUM1tx6 X-Received: by 2002:a17:903:2287:b0:1a9:bdf8:f551 with SMTP id b7-20020a170903228700b001a9bdf8f551mr2601179plh.69.1684495100581; Fri, 19 May 2023 04:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684495100; cv=none; d=google.com; s=arc-20160816; b=AWjDeAIoTt2aIZ5wMj/jl6MjEi2H4fkIjVEaS+64gTSnVw4u4KgYW4+I89uSps9ERn tsaFPRtgOFIkjv8qBuZ2lhTUy2iK5IKMIOyalwNM0n1+KqQ1Og9t4+yqRa00VGSdcZ/U jwFnIev8rd3+2GU3nmipPqSeVlJR2BebEX7U/GNn9zvI914pLrmsJmNM7MsWUM9pkP1u CC35DkMeaII9MhIVPl2/D1W4Kfi2+GZo/HfLVX1B8vgkDRveDVVVs1YG7KVOyYdIS8ls GFHs2I2t5S3MGvG7OWU+uF53he7BaBTsbyZrwzUlhMWJFYnx0GApa5CDd1qzZL2zooQh o+aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3uZYfx3hyEjD6ZwDLsclbF5cJ3UWQoHkrfkUlHvER1Q=; b=QE5+RLkhvlVg36+LmTf+Mv1M4QOrSRoM5PX6xO7DBZrzkbBX4+A4nKRihNPrn89BXt T3CiEHi3sUNYE7kKHIdGOpDV10UqejH6xXZOyaP1ucL80Xq3i43OgxyCjxpPF2TAl0Tr LxhFIWPgwOIfKjBLw0VySIKxgWhdD9Zsrr2kns82o9SwssPKyI8rl6qsoXPeGzlMlGsn EDRyEs9lAbGMUGoHIqhLHpG0s0JO3e/XA7f9RW60XDU2nYJSWmylWrNJ31xNfD7EHpUT Egde0ikneLGcuM3R5VBWLV8uLhZ+jd+PNYG8ku3R2ZJ57Olqi822ehZMIQIZDsOZgjNF LxPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z6kLA7vT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 18-20020a170902c25200b001adbb45eae6si789731plg.331.2023.05.19.04.18.04; Fri, 19 May 2023 04:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z6kLA7vT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbjESLCI (ORCPT + 99 others); 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-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-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yAqnyeIsXokB1xoj" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yAqnyeIsXokB1xoj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable fwnode_irq_get() was changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen --- Revsion history: v4 =3D> v5: - drop unnecessary data->irqnr =3D -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; } =20 - if (data->irqnr >=3D 0) { + if (data->irqnr > 0) { /* it cannot take more than 100 ms */ ret =3D 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); =20 data->irqnr =3D fwnode_irq_get(dev_fwnode(&client->dev), 0); - if (data->irqnr <=3D 0) { - /* usage of interrupt is optional */ - data->irqnr =3D -1; - } else { + if (data->irqnr > 0) { ret =3D devm_request_irq(dev, data->irqnr, mb1232_handle_irq, IRQF_TRIGGER_FALLING, id->name, indio_dev); if (ret < 0) { --=20 2.40.1 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --yAqnyeIsXokB1xoj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmRnVwMACgkQeFA3/03a ocWx8wf/SZhPLICGA2ctdRPjftLJaB0DYTxdKSrpiMt6wgeBNbAcmfkeLIm6QiWo TejAiHYV1SDtSjcyuPb17gm/pCu0WHlS2Tmzp+t6oDEP8MN7QWB44GPm7DhCl+Ul l78kuAlqLywHS0mGH1GnvuYdymy/dw2FA6YsSTXVwfuzTF0wP/VQWRPHZfevW/7R Sc5eLe2kR/vTWy3DEfc5c8Gb71RrujlvQZcM198tt258BPDwyFa+V7sVy/FKPwMK qhkWzXrwiUjEbWbV3BbmaOibSw+vuoKnMD3esBlKaVtuc/i6LtGvGdOCUNhhLzZS kZwc3XvGRsUvPU054RVPj4OulqPILA== =R0S3 -----END PGP SIGNATURE----- --yAqnyeIsXokB1xoj--