All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Andy Tang <andy.tang@nxp.com>,
	Alexander Stein <alexander.stein@systec-electronic.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] irqchip: add support for Layerscape external interrupt lines
Date: Thu, 1 Mar 2018 13:16:47 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1803011308440.1396@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20180223210901.23480-2-rasmus.villemoes@prevas.dk>

On Fri, 23 Feb 2018, Rasmus Villemoes wrote:
> +#include <linux/irq.h>
> +#include <linux/irqchip.h>
> +#include <linux/irqdomain.h>
> +#include <linux/of.h>

of.h is already included from of_irq.h and of_address.h

> +#include <linux/of_irq.h>
> +#include <linux/of_address.h>
> +static int
> +ls_extirq_set_type(struct irq_data *data, unsigned int type)
> +{
> +	irq_hw_number_t hwirq = data->hwirq;
> +	struct extirq_chip_data *chip_data = data->chip_data;
> +	u32 value, mask;

Please order local variables in reverse fir tree fashion whenever
possible. That's way simpler to read:

	struct extirq_chip_data *chip_data = data->chip_data;
	irq_hw_number_t hwirq = data->hwirq;
	u32 value, mask;

> +
> +	if (chip_data->bit_reverse)
> +		mask = 1U << (31 - hwirq);
> +	else
> +		mask = 1U << hwirq;
> +
> +	switch (type) {
> +	case IRQ_TYPE_LEVEL_LOW:
> +		type = IRQ_TYPE_LEVEL_HIGH;
> +		value = mask;
> +		break;
> +	case IRQ_TYPE_EDGE_FALLING:
> +		type = IRQ_TYPE_EDGE_RISING;
> +		value = mask;
> +		break;
> +	case IRQ_TYPE_LEVEL_HIGH:
> +	case IRQ_TYPE_EDGE_RISING:
> +		value = 0;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	regmap_update_bits(chip_data->syscon, chip_data->intpcr, mask, value);
> +
> +	data = data->parent_data;
> +	return data->chip->irq_set_type(data, type);

  	irq_chip_set_type_parent() 

Thanks,

	tglx

  reply	other threads:[~2018-03-01 12:16 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 15:11 polarity inversion on LS1021a Rasmus Villemoes
2017-12-04 15:23 ` Marc Zyngier
2017-12-08 14:33   ` [RFC] irqchip: add support for LS1021A external interrupt lines Rasmus Villemoes
2017-12-08 14:33     ` Rasmus Villemoes
2017-12-08 15:11     ` Alexander Stein
2017-12-08 15:11       ` Alexander Stein
2017-12-08 16:09       ` Marc Zyngier
2017-12-08 16:09         ` Marc Zyngier
2017-12-11  9:08         ` Rasmus Villemoes
2017-12-11  9:08           ` Rasmus Villemoes
2017-12-11  9:45           ` Alexander Stein
2017-12-11  9:45             ` Alexander Stein
2017-12-11 10:02             ` Alexander Stein
2017-12-11 10:02               ` Alexander Stein
2017-12-11 13:45               ` Rasmus Villemoes
2017-12-11 13:45                 ` Rasmus Villemoes
2017-12-11 14:06                 ` Rasmus Villemoes
2017-12-11 14:06                   ` Rasmus Villemoes
2017-12-11 14:38                   ` Alexander Stein
2017-12-11 14:38                     ` Alexander Stein
2017-12-08 16:02     ` Marc Zyngier
2017-12-08 16:02       ` Marc Zyngier
2017-12-11  9:30       ` Rasmus Villemoes
2017-12-11  9:30         ` Rasmus Villemoes
2017-12-11 18:29         ` Marc Zyngier
2017-12-11 18:29           ` Marc Zyngier
2017-12-12 23:28     ` Rob Herring
2017-12-12 23:28       ` Rob Herring
2017-12-15 22:55       ` Rasmus Villemoes
2017-12-15 22:55         ` Rasmus Villemoes
2017-12-21 22:45         ` Rob Herring
2017-12-21 22:45           ` Rob Herring
2017-12-20  8:30     ` [PATCH v2 1/2] irqchip: add support for Layerscape " Rasmus Villemoes
2017-12-20  8:30       ` [PATCH v2 2/2] dt/bindings: Add bindings for Layerscape external irqs Rasmus Villemoes
2017-12-20  8:30         ` Rasmus Villemoes
2017-12-21 22:44         ` Rob Herring
2017-12-21 22:44           ` Rob Herring
2018-01-22  9:21       ` [PATCH v3 1/2] irqchip: add support for Layerscape external interrupt lines Rasmus Villemoes
2018-01-22  9:21         ` [PATCH v3 2/2] dt/bindings: Add bindings for Layerscape external irqs Rasmus Villemoes
2018-01-22  9:21           ` Rasmus Villemoes
2018-01-24 15:28           ` Marc Zyngier
2018-01-25 15:02         ` [PATCH v4 1/2] irqchip: add support for Layerscape external interrupt lines Rasmus Villemoes
2018-01-25 15:02           ` [PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs Rasmus Villemoes
2018-01-25 15:02             ` Rasmus Villemoes
2018-02-05  6:07             ` Rob Herring
2018-02-05  6:07               ` Rob Herring
2018-02-08 15:08               ` Rasmus Villemoes
2018-02-09  9:47                 ` Marc Zyngier
2018-02-09  9:47                   ` Marc Zyngier
2018-02-23 21:08           ` [PATCH v5 0/2] irqchip: add support for Layerscape external interrupt lines Rasmus Villemoes
2018-02-23 21:08             ` [PATCH v5 1/2] " Rasmus Villemoes
2018-03-01 12:16               ` Thomas Gleixner [this message]
2018-05-04  7:44                 ` Rasmus Villemoes
2019-09-17  9:39                   ` Kurt Kanzenbach
2018-02-23 21:09             ` [PATCH v5 2/2] dt/bindings: Add bindings for Layerscape external irqs Rasmus Villemoes
2018-03-02 19:49               ` Rob Herring
2018-05-04  8:07                 ` Rasmus Villemoes
2017-12-04 15:31 ` polarity inversion on LS1021a Alexander Stein
2017-12-04 15:37   ` Marc Zyngier
2017-12-04 16:04     ` Alexander Stein

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=alpine.DEB.2.21.1803011308440.1396@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=alexander.stein@systec-electronic.com \
    --cc=andy.tang@nxp.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@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 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.