Re: [PATCH 1/3] rtc: rtc-spear: Use devm_*() routines

From: Viresh Kumar
Date: Thu Nov 08 2012 - 22:07:31 EST


On 8 November 2012 20:07, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> This patch frees rtc-spear driver from tension of freeing resources :)
> devm_* derivatives of multiple routines are used while allocating resources,
> which would be freed automatically by kernel.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Hi Andrew,

Can you please apply this fixup to this patch?

commit ad4a753df699e525d9c91a353f4406fd0e363599
Author: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
Date: Fri Nov 9 08:36:29 2012 +0530

fixup! rtc: rtc-spear: Use devm_*() routines
---
drivers/rtc/rtc-spear.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 0c4805c..141fc94 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -363,11 +363,6 @@ static int __devinit spear_rtc_probe(struct
platform_device *pdev)
dev_err(&pdev->dev, "no resource defined\n");
return -EBUSY;
}
- if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
- pdev->name)) {
- dev_err(&pdev->dev, "rtc region already claimed\n");
- return -EBUSY;
- }

config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
if (!config) {
@@ -390,10 +385,9 @@ static int __devinit spear_rtc_probe(struct
platform_device *pdev)
return status;
}

- config->ioaddr = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
+ config->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
if (!config->ioaddr) {
- dev_err(&pdev->dev, "ioremap fail\n");
+ dev_err(&pdev->dev, "request-ioremap fail\n");
return -ENOMEM;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/