* [PATCH] sh_keysc: Remove request_mem_region() and release_mem_region()
@ 2008-07-18 8:38 Tetsuya Mukawa
2008-07-18 11:55 ` Magnus Damm
0 siblings, 1 reply; 3+ messages in thread
From: Tetsuya Mukawa @ 2008-07-18 8:38 UTC (permalink / raw)
To: linux-input
Cc: linux-sh, dmitry.torokhov, magnus.damm, Tetsuya Mukawa, lethal,
akpm
Remove request_mem_region() and release_mem_region() from sh_keysc driver.
Those functions can find resource conflict, but it is already checked in
platform_device_add().
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
drivers/input/keyboard/sh_keysc.c | 27 +++++++--------------------
1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index 8486abc..c600ab7 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -158,25 +158,18 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata));
pdata = &priv->pdata;
- res = request_mem_region(res->start, res_size(res), pdev->name);
- if (res == NULL) {
- dev_err(&pdev->dev, "failed to request I/O memory\n");
- error = -EBUSY;
- goto err1;
- }
-
priv->iomem_base = ioremap_nocache(res->start, res_size(res));
if (priv->iomem_base == NULL) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
error = -ENXIO;
- goto err2;
+ goto err1;
}
priv->input = input_allocate_device();
if (!priv->input) {
dev_err(&pdev->dev, "failed to allocate input device\n");
error = -ENOMEM;
- goto err3;
+ goto err2;
}
input = priv->input;
@@ -194,7 +187,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev);
if (error) {
dev_err(&pdev->dev, "failed to request IRQ\n");
- goto err4;
+ goto err3;
}
for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
@@ -206,7 +199,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
error = input_register_device(input);
if (error) {
dev_err(&pdev->dev, "failed to register input device\n");
- goto err5;
+ goto err4;
}
iowrite16((sh_keysc_mode[pdata->mode].kymd << 8) |
@@ -214,14 +207,12 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
iowrite16(0, priv->iomem_base + KYOUTDR_OFFS);
iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS);
return 0;
- err5:
- free_irq(irq, pdev);
err4:
- input_free_device(input);
+ free_irq(irq, pdev);
err3:
- iounmap(priv->iomem_base);
+ input_free_device(input);
err2:
- release_mem_region(res->start, res_size(res));
+ iounmap(priv->iomem_base);
err1:
platform_set_drvdata(pdev, NULL);
kfree(priv);
@@ -232,7 +223,6 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
static int __devexit sh_keysc_remove(struct platform_device *pdev)
{
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
- struct resource *res;
iowrite16(KYCR2_IRQ_DISABLED, priv->iomem_base + KYCR2_OFFS);
@@ -240,9 +230,6 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev)
free_irq(platform_get_irq(pdev, 0), pdev);
iounmap(priv->iomem_base);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- release_mem_region(res->start, res_size(res));
-
platform_set_drvdata(pdev, NULL);
kfree(priv);
return 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sh_keysc: Remove request_mem_region() and release_mem_region()
2008-07-18 8:38 [PATCH] sh_keysc: Remove request_mem_region() and release_mem_region() Tetsuya Mukawa
@ 2008-07-18 11:55 ` Magnus Damm
2008-07-18 22:48 ` Paul Mundt
0 siblings, 1 reply; 3+ messages in thread
From: Magnus Damm @ 2008-07-18 11:55 UTC (permalink / raw)
To: Tetsuya Mukawa; +Cc: linux-input, linux-sh, dmitry.torokhov, lethal, akpm
On Fri, Jul 18, 2008 at 5:38 PM, Tetsuya Mukawa <mukawa@igel.co.jp> wrote:
> Remove request_mem_region() and release_mem_region() from sh_keysc driver.
> Those functions can find resource conflict, but it is already checked in
> platform_device_add().
Yes, the request_mem_region() and release_mem_region() calls are redundant.
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Thanks for the patch! =)
/ magnus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sh_keysc: Remove request_mem_region() and release_mem_region()
2008-07-18 11:55 ` Magnus Damm
@ 2008-07-18 22:48 ` Paul Mundt
0 siblings, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-07-18 22:48 UTC (permalink / raw)
To: Magnus Damm; +Cc: Tetsuya Mukawa, linux-input, linux-sh, dmitry.torokhov, akpm
On Fri, Jul 18, 2008 at 08:55:04PM +0900, Magnus Damm wrote:
> On Fri, Jul 18, 2008 at 5:38 PM, Tetsuya Mukawa <mukawa@igel.co.jp> wrote:
> > Remove request_mem_region() and release_mem_region() from sh_keysc driver.
> > Those functions can find resource conflict, but it is already checked in
> > platform_device_add().
>
> Yes, the request_mem_region() and release_mem_region() calls are redundant.
>
> > Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
>
> Thanks for the patch! =)
>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-18 22:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 8:38 [PATCH] sh_keysc: Remove request_mem_region() and release_mem_region() Tetsuya Mukawa
2008-07-18 11:55 ` Magnus Damm
2008-07-18 22:48 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).