* [PATCH] Input: pxa27x_keypad - Use resource_size
@ 2009-09-18 7:13 Tobias Klauser
2009-09-18 7:58 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2009-09-18 7:13 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Russell King, linux-input, Tobias Klauser
Use resource size from linux/ioport.h instead of the private macro
res_size.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/input/keyboard/pxa27x_keypad.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 0d2fc64..911cebc 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -425,8 +425,6 @@ static int pxa27x_keypad_resume(struct platform_device *pdev)
#define pxa27x_keypad_resume NULL
#endif
-#define res_size(res) ((res)->end - (res)->start + 1)
-
static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
{
struct pxa27x_keypad *keypad;
@@ -461,14 +459,14 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
goto failed_free;
}
- res = request_mem_region(res->start, res_size(res), pdev->name);
+ res = request_mem_region(res->start, resource_size(res), pdev->name);
if (res == NULL) {
dev_err(&pdev->dev, "failed to request I/O memory\n");
error = -EBUSY;
goto failed_free;
}
- keypad->mmio_base = ioremap(res->start, res_size(res));
+ keypad->mmio_base = ioremap(res->start, resource_size(res));
if (keypad->mmio_base == NULL) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
error = -ENXIO;
@@ -540,7 +538,7 @@ failed_put_clk:
failed_free_io:
iounmap(keypad->mmio_base);
failed_free_mem:
- release_mem_region(res->start, res_size(res));
+ release_mem_region(res->start, resource_size(res));
failed_free:
kfree(keypad);
return error;
@@ -562,7 +560,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev)
iounmap(keypad->mmio_base);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- release_mem_region(res->start, res_size(res));
+ release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
kfree(keypad);
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: pxa27x_keypad - Use resource_size
2009-09-18 7:13 [PATCH] Input: pxa27x_keypad - Use resource_size Tobias Klauser
@ 2009-09-18 7:58 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2009-09-18 7:58 UTC (permalink / raw)
To: Tobias Klauser; +Cc: Russell King, linux-input
Hi Tobias,
On Fri, Sep 18, 2009 at 09:13:41AM +0200, Tobias Klauser wrote:
> Use resource size from linux/ioport.h instead of the private macro
> res_size.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Thank you for the patch but a similar change has already been committed.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-18 7:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18 7:13 [PATCH] Input: pxa27x_keypad - Use resource_size Tobias Klauser
2009-09-18 7:58 ` Dmitry Torokhov
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.