Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2015373rwd; Thu, 25 May 2023 23:51:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5M9AzodwstjYSuJd71JedkUGzvnmsxiIpP9Jo8bL1OukDE2jQHKbSm9Xswqc9Wmd6iQKS2 X-Received: by 2002:a05:6a21:3398:b0:105:dafa:fec2 with SMTP id yy24-20020a056a21339800b00105dafafec2mr1121971pzb.53.1685083899905; Thu, 25 May 2023 23:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685083899; cv=none; d=google.com; s=arc-20160816; b=DaKlU3yM+Ty+vQ03X8S6WE+KNhNYi7Ii28/1YXiez8grwUKzVjPLUvAvHQUy0/hImQ tr2/lFloXSIr2DF2w1ONRM/8vRG/C4iot40WhPn1Rq9QsUBohivky3x/SPkxhISzaXo1 kLczrVl4DPzsZnrrOZV0FkUDUuBImx05JQ6kUPtfmc2BTLkXlA+1ip9p7sF0s4NL8egp EapHpQu6kPkEwFghCYAyDPDYMyzAKQL7IZvrHTMJmyGMbrMbb40bASaCmhJ0b2hkWgq5 VbrcXAdHvTttSyqqO4hNLTOzvc2tQqYpaUwrdDvIJArdRQ1+Vl4i7uAMTu7zY8UZad1s onqg== 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=ibHKBwm98vUEtm+6oAfn7y9WF5igvmXGkvEzcD82yTg=; b=a+4xCtEWGVuoNXEBJ40gBe6Yj+znU5M5UJA5Ms9zi0GE+6Yuz8POw+ueM1K3PAbQmD nZC0cHgJtE87s4XBSwWbyLyh9wd6Kw1gYfo6ptBc3J6xMrqWNF91GDrc1ToyBF3IMfp3 TKk4NeF54rHR4Zl0cEJ5UlJA0q3MGWTtR70ODjjZjIoye1utToLfVl+og8pvqJi5wTp1 p9/1+Z190917EGYkHxs2bRPRAUrCp4KBRT+06Kl0P6lFwIFhjEQ5xocECQsYzW+k+/Gd HhDnRlIkDF3PeSqm+DMcV8J8wCcPBemEc67jhvbC1jSH9afu/93clVvBKEiCSbRKEJ1H +D7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QFcrXmc1; 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 l64-20020a622543000000b0064d419dd566si508338pfl.205.2023.05.25.23.51.27; Thu, 25 May 2023 23:51:39 -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=QFcrXmc1; 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 S230061AbjEZGgf (ORCPT + 99 others); Fri, 26 May 2023 02:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236328AbjEZGgc (ORCPT ); Fri, 26 May 2023 02:36:32 -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 466DF12E; Thu, 25 May 2023 23:36:29 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4eed764a10cso346745e87.0; Thu, 25 May 2023 23:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685082987; x=1687674987; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ibHKBwm98vUEtm+6oAfn7y9WF5igvmXGkvEzcD82yTg=; b=QFcrXmc1tI3PjA4ZyAn7pd37Ak2J3/PkBeGJ+U+ma2YDn79vzGar15Lb3UbTMSxX1s aCBXbzPS36K0IEeIQnz/j9SFAbivJHwCXdPpmB0WBmgl3JlwkVXPFPtzmDaY4FFM3LqU DxpNQEOwP8Gvg8zfdIRaB0tJd8YuCh+9Vhe7dsRGk8S2/Hg9szZuyY6EYH/1HYC8eiZV xlT1HcHnilEVAdxRSrazc7jlvPF8IuRraZbxvx11DZDH6kUUfNd00zNMCTPpD6fZXBXM cW3p1Eym2cSRuCVmXQ+pFdaaYCjQhbvWeB+vsGMYTtjM60b672wAHE6DVcZtyE6JGrgg yyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685082987; x=1687674987; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ibHKBwm98vUEtm+6oAfn7y9WF5igvmXGkvEzcD82yTg=; b=X9mD5KVcCGKBMOqdOXIbFdqBGF2Q7VFRihzRElfRcf+WOrEAIEdX2QTO60bHm+oFqD 8X4dJVW2Vo8erSP/SVScG9Sbwztc4HK7NP45kD4u5LZIYCi9l6HO2r3LUY+4DQl1tkxV 0NZkRYZGylOVJSEa1E60PTv+xSxsV+okidPOHOkLYGvqvSplJS0/LY1hYsVlZO4dugHe kHRZoTb0R6j97f0LMO5YPplIMpFZZqrIo7zC8Vjg35QcihMr3T1OaqcvhLbB6PaGHrzj if9pZc5wAEjWRVhpONJ785EIoFj4qgqjTNIwEwdBE9NMpYpAiGIVdCSQ03osKsWJCLd6 lQtQ== X-Gm-Message-State: AC+VfDztmhyRI6ggLxiV7I7rDrTY/ApaPV6l5oe1uT11NQwTBjAaLErY +63iEv3NL0EVwxePmXOSF1o= X-Received: by 2002:ac2:54b2:0:b0:4f2:6817:2379 with SMTP id w18-20020ac254b2000000b004f268172379mr192487lfk.23.1685082987373; Thu, 25 May 2023 23:36:27 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id u22-20020ac243d6000000b004edc7f6ee44sm480279lfl.234.2023.05.25.23.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:36:26 -0700 (PDT) Date: Fri, 26 May 2023 09:36:15 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?Q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v6 2/8] iio: mb1232: relax return value check for IRQ get Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/+3qr3fLL7Q81NGw" 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 --/+3qr3fLL7Q81NGw 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 Acked-by: Jonathan Cameron Reviewed-by: Andy Shevchenko --- Revsion history: v5 =3D>: - No changes 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 --/+3qr3fLL7Q81NGw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmRwU18ACgkQeFA3/03a ocVmyQf+NK1laLHO4rBaZyM3i1ZZWNS4IdGmlbloDvSboApdPxM/wPyyl/y7Xp4l ZruWMZZbrNySOkEU6Y7dQP1zntVU4smH0XVuKjQ+H/bSZ+UXFe+/fOjHmMHXrbKv uwO1C18ieVYZ49fHsEENkok4w38KacgDqR4IMy3RbWZiP2TKGuUi/8nyh23p8/dn cTCpYi6a6/9//ql/fkqsei2kAWmgtjfCTx/owl6ax9AMo5IMZkdujBvygsfP55LZ jAa6kggV848Kh1YJeDCk5nz0iZFMmgCtU0kDiMZZyq6XOuCv7nf1HTenRtBdJfHC DODfTe29bDrbyXkbxBx+aHDKM/635Q== =NT01 -----END PGP SIGNATURE----- --/+3qr3fLL7Q81NGw--