Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp885581rwd; Sat, 20 May 2023 08:22:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7HCuwykdTzAO1Fyfzuw3n7E9Chg4dgqowHoja7nXkS9zINsgJxvwWNxdpSxW3gbbNvvoFe X-Received: by 2002:a05:6a20:728c:b0:ff:da37:ae9 with SMTP id o12-20020a056a20728c00b000ffda370ae9mr6368558pzk.53.1684596128591; Sat, 20 May 2023 08:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684596128; cv=none; d=google.com; s=arc-20160816; b=EOCJc0sG2UD3IaRGOBbQxfQeP3OG7DMRC0eH5Lznhb5Tlo2E4L/uqhBPlYl/Ce7oAe Htoq7S7zqfLVgqhQCSEfeU8p84kW//e3X9FC6nB+x4/Bzs5ghd3QhSk717hCKv7Pz7qu 006/BlFS+3d1Baak16wUKJ8P7D9yGnOGEFXrhfR+JQca/XVcYCOFdT7toixFEnlOYa2u iK7awGBGsXK7AbKxBd5RfCGegFt3V3H8TdMs+CIXyOvGWdC4SQb8jqjvDgEDUuUsOUXx N5SgakV2gId/p3dPQEppj2QgbGTBBQdLeFt5gr5p4CZRfHCVYIo0lr2Jw2CMn6SrDERK Xlbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Icodxb2iKvUGgtLfnOWe4IRxcLHfCcasSPzq7LkJeS4=; b=tyXiC+mQVGbY/HiOSqyFQ2M1XDEwmTtciEJMX2BOTSmgMTZB11bj7ALkFSz7fr2Bix WINItWbESMjwZpm4m1OXHFVvfQ9WBTv1jsvVEZl501oa9Zu1O+j3XfeJQb8BId7ETgXH s/3cHS9X6+5J11IaMuyhuOJ4sFXH2gJdq85pPbGjZM7Z0REmai2TBtyHX0FbO1Q0PpTw CvbvGFeDh1q0Eyq2OiXAjRbqkS96pc9ix0e0AqCCzWxLhsDABPRaygJ5T+rCD0oAc2jP 5WOekRKdoj9ci4rzXvXS1YIGDNxRVe1XqpL99USMlScPv2LLo58fgRAhIouyPsPXVu+Q +Ing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fk8RBRN4; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z190-20020a6333c7000000b0051322a8d2aesi1699836pgz.110.2023.05.20.08.21.55; Sat, 20 May 2023 08:22:08 -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=@kernel.org header.s=k20201202 header.b=Fk8RBRN4; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231263AbjETPQq (ORCPT + 99 others); Sat, 20 May 2023 11:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjETPQp (ORCPT ); Sat, 20 May 2023 11:16:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 712A4EE; Sat, 20 May 2023 08:16:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C71160A4A; Sat, 20 May 2023 15:16:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63A72C433EF; Sat, 20 May 2023 15:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684595803; bh=UGvLhlhaGVuZ1xNTf9EdfX6bmO7ekWIS/JxQ4csPyO4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Fk8RBRN4CpUt2XfHmROjEBC6rq1EM5kZM+neDoJm+QOW/TFLuzJb+OVPs9Ka546V6 zxjXdoIvK2neuvr77CwHUI8Qs8GDjdCoqO9VUkbXv8qld00GuRL70NfeyyrA8jPvmp 9VPuAgV7/biO6/3p/NI9LQuhgSNercRdPA7WnAClUu31zIB3H9w6hWMl0tLHA+jhsB GQMHQF9D+Ewv1+JSjD6gG7bgpl/rDOrip1hn7nuQhM0sZsPRqs8bLFTGoBBLi1BS1Z KTtNUn9fKOJTKYwS1Bdf4FUtRHY647HYY3rLAMopGe4tbdLCwXhNM/hQqDOqwrCwWO qDFvoT+MzECuQ== Date: Sat, 20 May 2023 16:32:49 +0100 From: Jonathan Cameron To: Matti Vaittinen Cc: Matti Vaittinen , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?UTF-8?B?TmV1c2Now6RmZXI=?= , 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: Re: [PATCH v5 2/8] iio: mb1232: relax return value check for IRQ get Message-ID: <20230520163249.56f1e56d@jic23-huawei> In-Reply-To: <05636b651b9a3b13aa3a3b7d3faa00f2a8de6bca.1684493615.git.mazziesaccount@gmail.com> References: <05636b651b9a3b13aa3a3b7d3faa00f2a8de6bca.1684493615.git.mazziesaccount@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, 19 May 2023 14:01:23 +0300 Matti Vaittinen wrote: > 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 > --- > 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) {