All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: linux-kernel@vger.kernel.org,
	Gregor Herburger <gregor.herburger@tq-group.com>,
	linux@ew.tq-group.com
Subject: Re: [PATCH v2 4/5] mfd: tqmx86: make IRQ setup errors non-fatal
Date: Thu, 20 Jun 2024 17:35:52 +0100	[thread overview]
Message-ID: <20240620163552.GQ3029315@google.com> (raw)
In-Reply-To: <38a69a56697a80486067f7817d4d0ed3bdea4257.1718626665.git.matthias.schiffer@ew.tq-group.com>

On Mon, 17 Jun 2024, Matthias Schiffer wrote:

> GPIO IRQ setup can fail either because an invalid IRQ was passed as a
> parameter, or because the GPIO controller does not support interrupts.
> Neither is severe enough to stop the whole probe; simply disable IRQ
> support in the GPIO resource when setup fails.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> v2: no changes (was patch 3/4)
> 
>  drivers/mfd/tqmx86.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
> index 5aa51ead00a28..7f9ccd83278dd 100644
> --- a/drivers/mfd/tqmx86.c
> +++ b/drivers/mfd/tqmx86.c
> @@ -259,13 +259,14 @@ static int tqmx86_probe(struct platform_device *pdev)
>  		err = tqmx86_setup_irq(dev, "GPIO", gpio_irq, io_base,
>  				       TQMX86_REG_IO_EXT_INT_GPIO_SHIFT);
>  		if (err)
> -			return err;
> +			gpio_irq = 0;
> +	}
>  
> +	if (gpio_irq)

Stacking identical if()s one after another doesn't sound very efficient.

Why not put the contents of this one inside the one above?

>  		/* Assumes the IRQ resource is first. */
>  		tqmx_gpio_resources[0].start = gpio_irq;
> -	} else {
> +	else
>  		tqmx_gpio_resources[0].flags = 0;
> -	}
>  
>  	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(dev, board_id);
>  
> -- 
> TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> Amtsgericht München, HRB 105018
> Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> https://www.tq-group.com/
> 

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-06-20 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 12:22 [PATCH v2 0/5] mfd: tqmx86: new hardware and GPIO/I2C IRQ improvements/additions Matthias Schiffer
2024-06-17 12:22 ` [PATCH v2 1/5] mfd: tqmx86: add board definitions for TQMx120UC, TQMx130UC and TQMxE41S Matthias Schiffer
2024-06-17 12:22 ` [PATCH v2 2/5] mfd: tqmx86: improve gpio_irq module parameter description Matthias Schiffer
2024-06-17 12:23 ` [PATCH v2 3/5] mfd: tqmx86: refactor GPIO IRQ setup Matthias Schiffer
2024-06-17 12:23 ` [PATCH v2 4/5] mfd: tqmx86: make IRQ setup errors non-fatal Matthias Schiffer
2024-06-20 16:35   ` Lee Jones [this message]
2024-06-24  7:43     ` Matthias Schiffer
2024-06-24 10:47       ` Lee Jones
2024-06-17 12:23 ` [PATCH v2 5/5] mfd: tqmx86: add I2C IRQ support Matthias Schiffer

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=20240620163552.GQ3029315@google.com \
    --to=lee@kernel.org \
    --cc=gregor.herburger@tq-group.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@ew.tq-group.com \
    --cc=matthias.schiffer@ew.tq-group.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.