Re: [PATCH 06/12] genericirq: make irq_chip related function to takedesc
From: Yinghai Lu
Date: Thu Mar 04 2010 - 14:20:43 EST
On 03/04/2010 06:31 AM, Thomas Gleixner wrote:
> On Thu, 4 Mar 2010, Yinghai Lu wrote:
>
>> /*
>> * Fixup enable/disable function pointers
>> */
>> void irq_chip_set_defaults(struct irq_chip *chip)
>> {
>> + if (!chip->desc_enable)
>> + chip->desc_enable = default_enable_desc;
>> + if (!chip->desc_disable)
>> + chip->desc_disable = default_disable_desc;
>> + if (!chip->desc_startup)
>> + chip->desc_startup = default_startup_desc;
>
> This will break all irq_chips which implement enable, disable or
> startup. so the check needs to be:
>
> if (!chip->enable && !chip->desc_enable)
>
>> + /*
>> + * We use chip->disable, when the user provided its own. When
>> + * we have default_disable set for chip->disable, then we need
>> + * to use default_shutdown, otherwise the irq line is not
>> + * disabled on free_irq():
>> + */
>> + if (!chip->desc_shutdown)
>> + chip->desc_shutdown = chip->desc_disable != default_disable_desc ?
>> + chip->desc_disable : default_shutdown_desc;
>> + if (!chip->desc_end)
>> + chip->desc_end = dummy_irq_chip.desc_end;
>
> Same here.
should be:
/*
* Fixup enable/disable function pointers
*/
static void irq_chip_set_defaults_desc(struct irq_chip *chip)
{
if (!chip->desc_enable && !chip->enable)
chip->desc_enable = default_enable_desc;
if (!chip->desc_disable)
chip->desc_disable = default_disable_desc;
if (!chip->desc_startup)
chip->desc_startup = default_startup_desc;
/*
* We use chip->disable, when the user provided its own. When
* we have default_disable set for chip->disable, then we need
* to use default_shutdown, otherwise the irq line is not
* disabled on free_irq():
*/
if (!chip->desc_shutdown)
chip->desc_shutdown = chip->desc_disable != default_disable_desc ?
chip->desc_disable : default_shutdown_desc;
if (!chip->desc_end)
chip->desc_end = dummy_irq_chip.desc_end;
}
static void irq_chip_set_defaults_irq(struct irq_chip *chip)
{
if (!chip->enable)
chip->enable = default_enable;
if (!chip->disable)
chip->disable = default_disable;
if (!chip->startup)
chip->startup = default_startup;
/*
* We use chip->disable, when the user provided its own. When
* we have default_disable set for chip->disable, then we need
* to use default_shutdown, otherwise the irq line is not
* disabled on free_irq():
*/
if (!chip->shutdown)
chip->shutdown = chip->disable != default_disable ?
chip->disable : default_shutdown;
if (!chip->end)
chip->end = dummy_irq_chip.end;
}
void irq_chip_set_defaults(struct irq_chip *chip)
{
if (chip->desc_mask && chip->desc_unmask)
irq_chip_set_defaults_desc(chip);
else
irq_chip_set_defaults_irq(chip);
if (!chip->name)
chip->name = chip->typename;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/