From: Jonathan Cameron <jic23@kernel.org>
To: Nuno Sa <nuno.sa@analog.com>
Cc: <linux-iio@vger.kernel.org>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH 3/3] iio: imu: adis16480: make use of irq_get_trigger_type()
Date: Sun, 21 Jan 2024 16:15:23 +0000 [thread overview]
Message-ID: <20240121161523.629f5e78@jic23-huawei> (raw)
In-Reply-To: <20240117-adis-improv-v1-3-7f90e9fad200@analog.com>
On Wed, 17 Jan 2024 14:10:51 +0100
Nuno Sa <nuno.sa@analog.com> wrote:
> There's no need to call both irq_get_irq_data() and
> irqd_get_trigger_type() as we already have an helper for that. This
> allows for code simplification.
>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Applied 2 and 3 to the togreg branch of iio.git and pushed out as testing until
I can rebase it on rc1.
Thanks,
Jonathan
> ---
> drivers/iio/imu/adis16480.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index fe520194a837..b40a55bba30c 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -1246,18 +1246,11 @@ static int adis16480_config_irq_pin(struct adis16480 *st)
> {
> struct device *dev = &st->adis.spi->dev;
> struct fwnode_handle *fwnode = dev_fwnode(dev);
> - struct irq_data *desc;
> enum adis16480_int_pin pin;
> unsigned int irq_type;
> uint16_t val;
> int i, irq = 0;
>
> - desc = irq_get_irq_data(st->adis.spi->irq);
> - if (!desc) {
> - dev_err(dev, "Could not find IRQ %d\n", irq);
> - return -EINVAL;
> - }
> -
> /* Disable data ready since the default after reset is on */
> val = ADIS16480_DRDY_EN(0);
>
> @@ -1285,7 +1278,7 @@ static int adis16480_config_irq_pin(struct adis16480 *st)
> * configured as positive or negative, corresponding to
> * IRQ_TYPE_EDGE_RISING or IRQ_TYPE_EDGE_FALLING respectively.
> */
> - irq_type = irqd_get_trigger_type(desc);
> + irq_type = irq_get_trigger_type(st->adis.spi->irq);
> if (irq_type == IRQ_TYPE_EDGE_RISING) { /* Default */
> val |= ADIS16480_DRDY_POL(1);
> } else if (irq_type == IRQ_TYPE_EDGE_FALLING) {
>
prev parent reply other threads:[~2024-01-21 16:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 13:10 [PATCH 0/3] iio: imu: adis: misc fixes/improvements Nuno Sa
2024-01-17 13:10 ` [PATCH 1/3] iio: imu: adis: ensure proper DMA alignment Nuno Sa
2024-01-21 16:12 ` Jonathan Cameron
2024-01-22 8:28 ` Nuno Sá
2024-01-17 13:10 ` [PATCH 2/3] iio: imu: adis16475: make use of irq_get_trigger_type() Nuno Sa
2024-01-17 13:10 ` [PATCH 3/3] iio: imu: adis16480: " Nuno Sa
2024-01-21 16:15 ` Jonathan Cameron [this message]
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=20240121161523.629f5e78@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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