public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Daney <david.daney@cavium.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: David Daney <ddaney.cavm@gmail.com>,
	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>,
	"devicetree-discuss@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>,
	Rob Herring <rob.herring@calxeda.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 2/4] MIPS: Octeon: Setup irq_domains for interrupts.
Date: Wed, 28 Mar 2012 18:33:54 -0700	[thread overview]
Message-ID: <4F73BC02.9090102@cavium.com> (raw)
In-Reply-To: <20120328223155.AD0A63E0DAA@localhost>

On 03/28/2012 03:31 PM, Grant Likely wrote:
> On Mon, 26 Mar 2012 12:31:19 -0700, David Daney<ddaney.cavm@gmail.com>  wrote:
>> From: David Daney<david.daney@cavium.com>
>>
>> Create two domains.  One for the GPIO lines, and the other for on-chip
>> sources.
>>
>> Signed-off-by: David Daney<david.daney@cavium.com>
>> ---
> [...]
>> +struct octeon_irq_gpio_domain_data {
>> +	unsigned int base_hwirq;
>> +};
>
> Hmmm...
>
>> +static int octeon_irq_gpio_xlat(struct irq_domain *d,
>> +				struct device_node *node,
>> +				const u32 *intspec,
>> +				unsigned int intsize,
>> +				unsigned long *out_hwirq,
>> +				unsigned int *out_type)
>> +{
> [...]
>> +	*out_hwirq = gpiod->base_hwirq + pin;
>
> ...base_hwirq is only used here...
>
> [...]
>> +		gpiod = kzalloc(sizeof (*gpiod), GFP_KERNEL);
>> +		if (gpiod) {
>> +			/* gpio domain host_data is the base hwirq number. */
>> +			gpiod->base_hwirq = 16;
>> +			irq_domain_add_linear(gpio_node, 16,&octeon_irq_domain_gpio_ops, gpiod);
>
> ... and it is unconditionally set to 16.  It looks to me like
> base_hwirq and the associated kzalloc() is unnecessary.
>

There is a little information asymmetry here.  You don't know that I 
have a patch queued up to add another user of the GPIO irq_domain that 
has a different base_hwirq.

I could re-do this to hard code it, and then add it back.  But it would 
really just be busy work.

David Daney

  reply	other threads:[~2012-03-29  1:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 19:31 [PATCH v7 0/4] MIPS: OCTEON: Use Device Tree David Daney
2012-03-26 19:31 ` [PATCH v7 1/4] MIPS: Don't define early_init_devtree() and device_tree_init() in prom.c for CPU_CAVIUM_OCTEON David Daney
2012-03-26 19:31 ` [PATCH v7 2/4] MIPS: Octeon: Setup irq_domains for interrupts David Daney
2012-03-27  1:56   ` Rob Herring
2012-03-27 18:24     ` David Daney
2012-03-27 22:05       ` Rob Herring
2012-03-27 22:31         ` David Daney
2012-03-28 14:21           ` Rob Herring
2012-03-28 16:16             ` David Daney
2012-03-28 22:08               ` Grant Likely
2012-03-29  1:46                 ` David Daney
2012-03-28 22:22       ` Grant Likely
2012-03-29  1:41         ` David Daney
2012-03-30 21:54           ` Grant Likely
2012-03-28 22:31   ` Grant Likely
2012-03-29  1:33     ` David Daney [this message]
2012-03-26 19:31 ` [PATCH v7 3/4] MIPS: Octeon: Add device tree source files David Daney
2012-03-27  2:38   ` Rob Herring
2012-03-27 18:45     ` David Daney
2012-03-26 19:31 ` [PATCH v7 4/4] MIPS: Octeon: Initialize and fixup device tree David Daney

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=4F73BC02.9090102@cavium.com \
    --to=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=rob.herring@calxeda.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