From patchwork Fri May 26 06:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256473 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 B9ADAC7EE23 for ; Fri, 26 May 2023 06:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbjEZGgd (ORCPT ); Fri, 26 May 2023 02:36:33 -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-Google-Smtp-Source: ACHHUZ6O+oj6UcceXRsZij+c0/OW154pLRpmpDX3QwmlOmJe/QhpMwKwIZUsm1H4wbSJBdNi05DZ4w== 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-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 Acked-by: Jonathan Cameron Reviewed-by: Andy Shevchenko --- Revsion history: v5 =>: - No changes v4 => v5: - drop unnecessary data->irqnr = -1 assignment The first patch of the series changes the fwnode_irq_get() so this depends on the first patch of the series and should not be applied alone. --- drivers/iio/proximity/mb1232.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c index e70cac8240af..3ae226297a00 100644 --- a/drivers/iio/proximity/mb1232.c +++ b/drivers/iio/proximity/mb1232.c @@ -76,7 +76,7 @@ static s16 mb1232_read_distance(struct mb1232_data *data) goto error_unlock; } - if (data->irqnr >= 0) { + if (data->irqnr > 0) { /* it cannot take more than 100 ms */ ret = wait_for_completion_killable_timeout(&data->ranging, HZ/10); @@ -212,10 +212,7 @@ static int mb1232_probe(struct i2c_client *client) init_completion(&data->ranging); data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0); - if (data->irqnr <= 0) { - /* usage of interrupt is optional */ - data->irqnr = -1; - } else { + if (data->irqnr > 0) { ret = devm_request_irq(dev, data->irqnr, mb1232_handle_irq, IRQF_TRIGGER_FALLING, id->name, indio_dev); if (ret < 0) {