Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189578
b: refs/heads/master
c: c783a29
h: refs/heads/master
v: v3
  • Loading branch information
Vladimir Zapolskiy authored and Linus Torvalds committed Apr 7, 2010
1 parent 37a6ded commit deaf1bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8725d5416213a145ccc9c236dbd26830ba409e00
refs/heads/master: c783a29efcbc90a90ccfec8956c7ff0854301c34
26 changes: 13 additions & 13 deletions trunk/drivers/rtc/rtc-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,21 +384,26 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
struct rtc_device *rtc;
struct rtc_plat_data *pdata = NULL;
u32 reg;
int ret, rate;
unsigned long rate;
int ret;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;

pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;

pdata->ioaddr = ioremap(res->start, resource_size(res));
if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), pdev->name))
return -EBUSY;

pdata->ioaddr = devm_ioremap(&pdev->dev, res->start,
resource_size(res));

clk = clk_get(&pdev->dev, "ckil");
if (IS_ERR(clk)) {
iounmap(pdata->ioaddr);
ret = PTR_ERR(clk);
goto exit_free_pdata;
}
Expand All @@ -413,8 +418,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
else if (rate == 38400)
reg = RTC_INPUT_CLK_38400HZ;
else {
dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n",
clk_get_rate(clk));
dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n", rate);
ret = -EINVAL;
goto exit_free_pdata;
}
Expand Down Expand Up @@ -450,19 +454,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
pdata->irq = platform_get_irq(pdev, 0);

if (pdata->irq >= 0 &&
request_irq(pdata->irq, mxc_rtc_interrupt, IRQF_SHARED,
pdev->name, pdev) < 0) {
devm_request_irq(&pdev->dev, pdata->irq, mxc_rtc_interrupt,
IRQF_SHARED, pdev->name, pdev) < 0) {
dev_warn(&pdev->dev, "interrupt not available.\n");
pdata->irq = -1;
}

return 0;

exit_put_clk:
clk_disable(pdata->clk);
clk_put(pdata->clk);

exit_free_pdata:
kfree(pdata);

return ret;
}
Expand All @@ -473,12 +477,8 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)

rtc_device_unregister(pdata->rtc);

if (pdata->irq >= 0)
free_irq(pdata->irq, pdev);

clk_disable(pdata->clk);
clk_put(pdata->clk);
kfree(pdata);
platform_set_drvdata(pdev, NULL);

return 0;
Expand Down

0 comments on commit deaf1bf

Please sign in to comment.