Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8597rwd; Sat, 13 May 2023 11:43:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Y5s2SiizgoijHTtkAZIrKzh+u/OxMBrNHA97eUMr8hlaeA01YF9MyY7utFGUOPhMznaYZ X-Received: by 2002:a05:6a20:431b:b0:101:4c8c:d1ee with SMTP id h27-20020a056a20431b00b001014c8cd1eemr20307549pzk.50.1684003384953; Sat, 13 May 2023 11:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684003384; cv=none; d=google.com; s=arc-20160816; b=jCAG9tDVEp3yJwXJ/b52iHa+CDvuprHaaQ43Vf3z8HKwg41EvLAlvUUKqTqDORy8Be VWDgpbhzENPK8ebrKfdweG9xCcND0n68p3BMF3/F8p7HLlNu1/jMtLmY6PM9DIyBESiJ 87aMaq2hBMsNA2eC7s+wwyo+0O6nI+p9praCzkTzbulsKMB4s7NW9N503dMQyfpzasad SHSc+hS+UsYWiizdUan5tCSzZzQOW0tuLgBZ5rmfVC2onkCr2Vg7W5Hki2Zp3yHUJC4n ePGksSmGi1dAqica85AOyJCPIZKmvY9LUMAqhFZBmv/KxyDq/KScTbOWs8IX3eqAmEax Oz7g== 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=/z+3V77xc5lD7MTZ9OX29L8j2xgvvH4C7CjwmYcCcRw=; b=uaLytSFEr8H//QrBlqZEB7QrSCSHXAFJpwUJ/5L8gX+xRjPhUDfH2OiX7TOJcCPcNx ja4Tb7r6gko1KR/nqgm7aLiS89hRmnQPUW/rU5iOPO4e3e622+Yzs/rZUW5qup3jlBJ6 Oa0mP/oxpFwJC1RfSktlbnV8+uyKFLBg+D5wp7fcc2aJWB5KcVfGGDUqD+mTs/gfXy+A VCPC8Q0TNLurCWRoxda50TR6GoH//0vQf3hteNTQj8sjIpunPrV93mZXtG+K7yD8xIIO uM9UjJWQaV7V1l7RnsbJIK0dE85LCF92yqI01Xi4p4vW5WVfj0+qQOmVRFRh8Xl2Fz46 ejUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dXy5AZHf; 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 s65-20020a637744000000b0053090c5d094si4854402pgc.648.2023.05.13.11.42.52; Sat, 13 May 2023 11:43:04 -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=dXy5AZHf; 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 S232868AbjEMS2G (ORCPT + 99 others); Sat, 13 May 2023 14:28:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjEMS2F (ORCPT ); Sat, 13 May 2023 14:28:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB981BC2; Sat, 13 May 2023 11:28:04 -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 29FDC61D52; Sat, 13 May 2023 18:28:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E298EC433EF; Sat, 13 May 2023 18:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684002483; bh=IcFg/niQ7za//Jek+VAgnrsOkVlFXJ4WpYiKlJMxZlk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dXy5AZHf3Wea0MdZGAF84hMMzImo/ZY28/weOHGKOioztGp7nO8FQJMfbv5Z94h/r dxHg7unMxIQYv2x4v6JGB2nPE9Z/7p1cQIOWeqMP7WMYGlHN7btfx0CdzS3SCqPX6I mw4d4x/q20j8uBoVgws2/ReQxURDfDPrm8Y+Ct2DbJObnBu7U6SKRLZOFfY6Qqw9No 8FZYWfjxLYcxbhfwAd/pjAQh3+zpovBf8OsPTnaTJ3fYf0hV/xrABSTAop4oddx7hj L4Ks+j7sjxfMOTD0nyFLCdhbwnpUOMr2herWBPOFSeU/uLI30YJiHstTWPiTp8V5Oo FtwUNwak+jtNA== Date: Sat, 13 May 2023 19:44:03 +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 , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH v3 3/3] iio: kx022a fix irq getting Message-ID: <20230513194403.234b4e3f@jic23-huawei> In-Reply-To: References: 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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, 12 May 2023 10:53:41 +0300 Matti Vaittinen wrote: > The fwnode_irq_get_byname() was returning 0 at device-tree mapping > error. If this occurred, the KX022A driver did abort the probe but > errorneously directly returned the return value from > fwnode_irq_get_byname() from probe. In case of a device-tree mapping > error this indicated success. > > The fwnode_irq_get_byname() has since been fixed to not return zero on > error so the check for fwnode_irq_get_byname() can be relaxed to only > treat negative values as errors. This will also do decent fix even when > backported to branches where fwnode_irq_get_byname() can still return > zero on error because KX022A probe should later fail at IRQ requesting > and a prober error handling should follow. On that basis I've picked this one up directly for the fixes-togreg branch of iio.git and marked it for stable. Thanks, Jonathan > > Relax the return value check for fwnode_irq_get_byname() to only treat > negative values as errors. > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202305110245.MFxC9bUj-lkp@intel.com/ > Link: https://lore.kernel.org/r/202305110245.MFxC9bUj-lkp@intel.com/ > Signed-off-by: Matti Vaittinen > Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer") > --- > drivers/iio/accel/kionix-kx022a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > index f98393d74666..b8636fa8eaeb 100644 > --- a/drivers/iio/accel/kionix-kx022a.c > +++ b/drivers/iio/accel/kionix-kx022a.c > @@ -1048,7 +1048,7 @@ int kx022a_probe_internal(struct device *dev) > data->ien_reg = KX022A_REG_INC4; > } else { > irq = fwnode_irq_get_byname(fwnode, "INT2"); > - if (irq <= 0) > + if (irq < 0) > return dev_err_probe(dev, irq, "No suitable IRQ\n"); > > data->inc_reg = KX022A_REG_INC5;