From: Jonathan Cameron <jic23@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Wolfram Sang <wsa@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Akhil R <akhilrajeev@nvidia.com>,
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
Date: Sat, 13 May 2023 19:44:03 +0100 [thread overview]
Message-ID: <20230513194403.234b4e3f@jic23-huawei> (raw)
In-Reply-To: <b45b4b638db109c6078d243252df3a7b0485f7d5.1683875389.git.mazziesaccount@gmail.com>
On Fri, 12 May 2023 10:53:41 +0300
Matti Vaittinen <mazziesaccount@gmail.com> 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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> 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 <mazziesaccount@gmail.com>
> 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;
next prev parent reply other threads:[~2023-05-13 18:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 7:52 [PATCH v3 0/3] fix fwnode_irq_get_byname() returnvalue Matti Vaittinen
2023-05-12 7:53 ` [PATCH v3 1/3] drivers: fwnode: fix fwnode_irq_get_byname() Matti Vaittinen
2023-05-13 18:40 ` Jonathan Cameron
2023-05-15 12:07 ` Matti Vaittinen
2023-05-12 7:53 ` [PATCH v3 2/3] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Matti Vaittinen
2023-05-12 7:53 ` [PATCH v3 3/3] iio: kx022a fix irq getting Matti Vaittinen
2023-05-13 18:44 ` Jonathan Cameron [this message]
2023-05-16 5:30 ` Matti Vaittinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230513194403.234b4e3f@jic23-huawei \
--to=jic23@kernel.org \
--cc=akhilrajeev@nvidia.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=djrscally@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mazziesaccount@gmail.com \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox