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: 13248200 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 B8F09C77B7A for ; Fri, 19 May 2023 11:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231862AbjESLCI (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-iio@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: 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) {