[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A0D6A39.2000104@grandegger.com>
Date: Fri, 15 May 2009 15:12:25 +0200
From: Wolfgang Grandegger <wg@...ndegger.com>
To: Sascha Hauer <s.hauer@...gutronix.de>
CC: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Marc Kleine-Budde <mkl@...gutronix.de>,
Oliver Hartkopp <oliver.hartkopp@...kswagen.de>
Subject: Re: [PATCH v2 5/7] [PATCH 5/8] can: SJA1000 generic platform bus
driver
Sascha Hauer wrote:
> On Fri, May 15, 2009 at 11:35:06AM +0200, Wolfgang Grandegger wrote:
>> Hi Sascha,
>>
>> Sascha Hauer wrote:
>>> Hi Wolfgang,
[...}
>>>> + irq = res_irq->start;
>>>> + if (res_irq->flags & IRQF_TRIGGER_MASK)
>>>> + set_irq_type(irq, res_irq->flags & IRQF_TRIGGER_MASK);
>>> You shouldn't use set_irq_type on not yet requested irqs but instead
>>> pass the flags to the real driver and pass them in request_irq.
>> Why? I would require an extra member in the struct sja1000_priv.
>
> You change a resource you do not own. What if request_irq returns with
> -EBUSY? You already screwed up any other potential user.
OK, I added irq_flags to struct sja1000_priv, which will then be used
by the request_irq(). The driver must to set it appropriately, including
IRQF_SHARED. This also fixes the problem, that drivers used IRQF_SHARED
without reason.
Thanks,
Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists