Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113099
b: refs/heads/master
c: 64151ad
h: refs/heads/master
i:
  113097: 3480179
  113095: dca2fdf
v: v3
  • Loading branch information
Krzysztof Helt authored and David S. Miller committed Sep 3, 2008
1 parent 225545b commit d3e93e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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: 94fe7424a4c21940b4569200faaf0a0a5efd2924
refs/heads/master: 64151ad5b3a03e236390d6d5160805ee4f4e7c67
14 changes: 10 additions & 4 deletions trunk/drivers/rtc/rtc-m48t59.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,14 @@ static int __devinit m48t59_rtc_probe(struct platform_device *pdev)
if (!m48t59)
return -ENOMEM;

m48t59->ioaddr = ioremap(res->start, res->end - res->start + 1);
if (!m48t59->ioaddr)
goto out;
m48t59->ioaddr = pdata->ioaddr;

if (!m48t59->ioaddr) {
/* ioaddr not mapped externally */
m48t59->ioaddr = ioremap(res->start, res->end - res->start + 1);
if (!m48t59->ioaddr)
goto out;
}

/* Try to get irq number. We also can work in
* the mode without IRQ.
Expand Down Expand Up @@ -481,11 +486,12 @@ static int __devinit m48t59_rtc_probe(struct platform_device *pdev)
static int __devexit m48t59_rtc_remove(struct platform_device *pdev)
{
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;

sysfs_remove_bin_file(&pdev->dev.kobj, &m48t59_nvram_attr);
if (!IS_ERR(m48t59->rtc))
rtc_device_unregister(m48t59->rtc);
if (m48t59->ioaddr)
if (m48t59->ioaddr && !pdata->ioaddr)
iounmap(m48t59->ioaddr);
if (m48t59->irq != NO_IRQ)
free_irq(m48t59->irq, &pdev->dev);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/rtc/m48t59.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct m48t59_plat_data {

int type; /* RTC model */

/* ioaddr mapped externally */
void __iomem *ioaddr;
/* offset to RTC registers, automatically set according to the type */
unsigned int offset;
};
Expand Down

0 comments on commit d3e93e2

Please sign in to comment.