[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110705135745.GN2820@legolas.emea.dhcp.ti.com>
Date: Tue, 5 Jul 2011 16:57:46 +0300
From: Felipe Balbi <balbi@...com>
To: Peter Ujfalusi <peter.ujfalusi@...com>
Cc: Liam Girdwood <lrg@...com>, Tony Lindgren <tony@...mide.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
Misael Lopez Cruz <misael.lopez@...com>,
Felipe Balbi <balbi@...com>
Subject: Re: [PATCH v2 2/5] input: twl6040-vibra: Do not use wrapper for irq
request
On Tue, Jul 05, 2011 at 04:49:32PM +0300, Peter Ujfalusi wrote:
> The twl6040_request_irq/free_irq inline functions are going
> to be removed, so replace them with direct calls.
> The irq number is provided by the core driver via resource.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> ---
> drivers/input/misc/twl6040-vibra.c | 17 ++++++++++++-----
> 1 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
> index dbf745d..50e09b0 100644
> --- a/drivers/input/misc/twl6040-vibra.c
> +++ b/drivers/input/misc/twl6040-vibra.c
> @@ -47,6 +47,7 @@ struct vibra_info {
> struct workqueue_struct *workqueue;
> struct work_struct play_work;
> struct mutex mutex;
> + int irq;
>
> bool enabled;
> int weak_speed;
> @@ -277,6 +278,13 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
> goto err_kzalloc;
> }
>
> + info->irq = platform_get_irq(pdev, 0);
> + if (!info->irq) {
this is wrong. platform_get_irq() will return -ENXIO if it can't find
the IRQ you requested:
55 /**
56 * platform_get_irq - get an IRQ for a device
57 * @dev: platform device
58 * @num: IRQ number index
59 */
60 int platform_get_irq(struct platform_device *dev, unsigned int num)
61 {
62 struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
63
64 return r ? r->start : -ENXIO;
65 }
66 EXPORT_SYMBOL_GPL(platform_get_irq);
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)
Powered by blists - more mailing lists