Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319705
b: refs/heads/master
c: c1a2f31
h: refs/heads/master
i:
  319703: 10faa12
v: v3
  • Loading branch information
Haojian Zhuang authored and Samuel Ortiz committed Jul 8, 2012
1 parent f677c42 commit 1d75304
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 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: b673e24c0ae041d02b51b13917ba89aafdd454ed
refs/heads/master: c1a2f31dfeb09c0c767fc178daa4a1e2855808a7
8 changes: 4 additions & 4 deletions trunk/drivers/mfd/max8925-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ static struct mfd_cell power_devs[] = {
static struct resource rtc_resources[] = {
{
.name = "max8925-rtc",
.start = MAX8925_RTC_IRQ,
.end = MAX8925_RTC_IRQ_MASK,
.flags = IORESOURCE_IO,
.start = MAX8925_IRQ_RTC_ALARM0,
.end = MAX8925_IRQ_RTC_ALARM0,
.flags = IORESOURCE_IRQ,
},
};

Expand Down Expand Up @@ -598,7 +598,7 @@ int __devinit max8925_device_init(struct max8925_chip *chip,

ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0],
ARRAY_SIZE(rtc_devs),
&rtc_resources[0], 0);
&rtc_resources[0], chip->irq_base);
if (ret < 0) {
dev_err(chip->dev, "Failed to add rtc subdev\n");
goto out;
Expand Down
13 changes: 7 additions & 6 deletions trunk/drivers/rtc/rtc-max8925.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct max8925_rtc_info {
struct max8925_chip *chip;
struct i2c_client *rtc;
struct device *dev;
int irq;
};

static irqreturn_t rtc_update_handler(int irq, void *data)
Expand Down Expand Up @@ -250,21 +251,21 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
{
struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct max8925_rtc_info *info;
int irq, ret;
int ret;

info = kzalloc(sizeof(struct max8925_rtc_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
info->chip = chip;
info->rtc = chip->rtc;
info->dev = &pdev->dev;
irq = chip->irq_base + MAX8925_IRQ_RTC_ALARM0;
info->irq = platform_get_irq(pdev, 0);

ret = request_threaded_irq(irq, NULL, rtc_update_handler,
ret = request_threaded_irq(info->irq, NULL, rtc_update_handler,
IRQF_ONESHOT, "rtc-alarm0", info);
if (ret < 0) {
dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n",
irq, ret);
info->irq, ret);
goto out_irq;
}

Expand All @@ -285,7 +286,7 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
return 0;
out_rtc:
platform_set_drvdata(pdev, NULL);
free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
free_irq(info->irq, info);
out_irq:
kfree(info);
return ret;
Expand All @@ -296,7 +297,7 @@ static int __devexit max8925_rtc_remove(struct platform_device *pdev)
struct max8925_rtc_info *info = platform_get_drvdata(pdev);

if (info) {
free_irq(info->chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
free_irq(info->irq, info);
rtc_device_unregister(info->rtc_dev);
kfree(info);
}
Expand Down

0 comments on commit 1d75304

Please sign in to comment.