From: Peter Ujfalusi <peter.ujfalusi@ti.com> To: Liam Girdwood <lrg@ti.com>, Tony Lindgren <tony@atomide.com>, Mark Brown <broonie@opensource.wolfsonmicro.com>, Samuel Ortiz <sameo@linux.intel.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Misael Lopez Cruz <misael.lopez@ti.com>, Felipe Balbi <balbi@ti.com> Subject: [PATCH v2 2/5] input: twl6040-vibra: Do not use wrapper for irq request Date: Tue, 5 Jul 2011 16:49:32 +0300 [thread overview] Message-ID: <1309873775-17927-3-git-send-email-peter.ujfalusi@ti.com> (raw) In-Reply-To: <1309873775-17927-1-git-send-email-peter.ujfalusi@ti.com> 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@ti.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) { + dev_err(info->dev, "invalid irq for vibra\n"); + ret = -EINVAL; + goto err_kzalloc; + } + mutex_init(&info->mutex); info->input_dev = input_allocate_device(); @@ -308,9 +316,8 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) platform_set_drvdata(pdev, info); - ret = twl6040_request_irq(info->twl6040, TWL6040_IRQ_VIB, - twl6040_vib_irq_handler, 0, - "twl6040_irq_vib", info); + ret = request_threaded_irq(info->irq, NULL, twl6040_vib_irq_handler, 0, + "twl6040_irq_vib", info); if (ret) { dev_err(info->dev, "VIB IRQ request failed: %d\n", ret); goto err_irq; @@ -360,7 +367,7 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) err_voltage: regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); err_regulator: - twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); + free_irq(info->irq, info); err_irq: input_unregister_device(info->input_dev); info->input_dev = NULL; @@ -379,7 +386,7 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev) struct vibra_info *info = platform_get_drvdata(pdev); input_unregister_device(info->input_dev); - twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); + free_irq(info->irq, info); regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); destroy_workqueue(info->workqueue); kfree(info); -- 1.7.6
WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com> To: Liam Girdwood <lrg@ti.com>, Tony Lindgren <tony@atomide.com>, Mark Brown <broonie@opensource.wolfsonmicro.com>, Samuel Ortiz <sameo@linux.intel.com>, Dmitry Torokhov <dmitry.torokhov@> Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Misael Lopez Cruz <misael.lopez@ti.com>, Felipe Balbi <balbi@ti.com> Subject: [PATCH v2 2/5] input: twl6040-vibra: Do not use wrapper for irq request Date: Tue, 5 Jul 2011 16:49:32 +0300 [thread overview] Message-ID: <1309873775-17927-3-git-send-email-peter.ujfalusi@ti.com> (raw) In-Reply-To: <1309873775-17927-1-git-send-email-peter.ujfalusi@ti.com> 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@ti.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) { + dev_err(info->dev, "invalid irq for vibra\n"); + ret = -EINVAL; + goto err_kzalloc; + } + mutex_init(&info->mutex); info->input_dev = input_allocate_device(); @@ -308,9 +316,8 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) platform_set_drvdata(pdev, info); - ret = twl6040_request_irq(info->twl6040, TWL6040_IRQ_VIB, - twl6040_vib_irq_handler, 0, - "twl6040_irq_vib", info); + ret = request_threaded_irq(info->irq, NULL, twl6040_vib_irq_handler, 0, + "twl6040_irq_vib", info); if (ret) { dev_err(info->dev, "VIB IRQ request failed: %d\n", ret); goto err_irq; @@ -360,7 +367,7 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) err_voltage: regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); err_regulator: - twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); + free_irq(info->irq, info); err_irq: input_unregister_device(info->input_dev); info->input_dev = NULL; @@ -379,7 +386,7 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev) struct vibra_info *info = platform_get_drvdata(pdev); input_unregister_device(info->input_dev); - twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); + free_irq(info->irq, info); regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); destroy_workqueue(info->workqueue); kfree(info); -- 1.7.6
next prev parent reply other threads:[~2011-07-05 13:49 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-07-05 13:49 [PATCH v2 0/5] MFD/input/ASoC: twl6040: irq registration changes Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi 2011-07-05 13:49 ` [PATCH v2 1/5] MFD: twl6040: Use resource to provide irq number for slaves Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi [this message] 2011-07-05 13:49 ` [PATCH v2 2/5] input: twl6040-vibra: Do not use wrapper for irq request Peter Ujfalusi 2011-07-05 13:57 ` Felipe Balbi 2011-07-05 14:10 ` Péter Ujfalusi 2011-07-05 14:10 ` Péter Ujfalusi 2011-07-05 13:49 ` [PATCH v2 3/5] ASoC: twl6040: " Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi 2011-07-05 17:59 ` Mark Brown 2011-07-05 17:59 ` Mark Brown 2011-07-05 22:38 ` Felipe Balbi 2011-07-05 13:49 ` [PATCH v2 4/5] MFD: twl6040: Demand valid interrupt configuration Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi 2011-07-05 13:49 ` [PATCH v2 5/5] MFD: twl6040: Remove wrapper for threaded irq request Peter Ujfalusi 2011-07-05 13:49 ` Peter Ujfalusi
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=1309873775-17927-3-git-send-email-peter.ujfalusi@ti.com \ --to=peter.ujfalusi@ti.com \ --cc=alsa-devel@alsa-project.org \ --cc=balbi@ti.com \ --cc=broonie@opensource.wolfsonmicro.com \ --cc=dmitry.torokhov@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=lrg@ti.com \ --cc=misael.lopez@ti.com \ --cc=sameo@linux.intel.com \ --cc=tony@atomide.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: linkBe 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.