diff options
Diffstat (limited to 'drivers/rtc/rtc-max8925.c')
| -rw-r--r-- | drivers/rtc/rtc-max8925.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c index 1459055a83aa..34e4349611db 100644 --- a/drivers/rtc/rtc-max8925.c +++ b/drivers/rtc/rtc-max8925.c | |||
| @@ -69,6 +69,7 @@ struct max8925_rtc_info { | |||
| 69 | struct max8925_chip *chip; | 69 | struct max8925_chip *chip; |
| 70 | struct i2c_client *rtc; | 70 | struct i2c_client *rtc; |
| 71 | struct device *dev; | 71 | struct device *dev; |
| 72 | int irq; | ||
| 72 | }; | 73 | }; |
| 73 | 74 | ||
| 74 | static irqreturn_t rtc_update_handler(int irq, void *data) | 75 | static irqreturn_t rtc_update_handler(int irq, void *data) |
| @@ -250,7 +251,7 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) | |||
| 250 | { | 251 | { |
| 251 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 252 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
| 252 | struct max8925_rtc_info *info; | 253 | struct max8925_rtc_info *info; |
| 253 | int irq, ret; | 254 | int ret; |
| 254 | 255 | ||
| 255 | info = kzalloc(sizeof(struct max8925_rtc_info), GFP_KERNEL); | 256 | info = kzalloc(sizeof(struct max8925_rtc_info), GFP_KERNEL); |
| 256 | if (!info) | 257 | if (!info) |
| @@ -258,13 +259,13 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) | |||
| 258 | info->chip = chip; | 259 | info->chip = chip; |
| 259 | info->rtc = chip->rtc; | 260 | info->rtc = chip->rtc; |
| 260 | info->dev = &pdev->dev; | 261 | info->dev = &pdev->dev; |
| 261 | irq = chip->irq_base + MAX8925_IRQ_RTC_ALARM0; | 262 | info->irq = platform_get_irq(pdev, 0); |
| 262 | 263 | ||
| 263 | ret = request_threaded_irq(irq, NULL, rtc_update_handler, | 264 | ret = request_threaded_irq(info->irq, NULL, rtc_update_handler, |
| 264 | IRQF_ONESHOT, "rtc-alarm0", info); | 265 | IRQF_ONESHOT, "rtc-alarm0", info); |
| 265 | if (ret < 0) { | 266 | if (ret < 0) { |
| 266 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", | 267 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", |
| 267 | irq, ret); | 268 | info->irq, ret); |
| 268 | goto out_irq; | 269 | goto out_irq; |
| 269 | } | 270 | } |
| 270 | 271 | ||
| @@ -285,7 +286,7 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) | |||
| 285 | return 0; | 286 | return 0; |
| 286 | out_rtc: | 287 | out_rtc: |
| 287 | platform_set_drvdata(pdev, NULL); | 288 | platform_set_drvdata(pdev, NULL); |
| 288 | free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); | 289 | free_irq(info->irq, info); |
| 289 | out_irq: | 290 | out_irq: |
| 290 | kfree(info); | 291 | kfree(info); |
| 291 | return ret; | 292 | return ret; |
| @@ -296,7 +297,7 @@ static int __devexit max8925_rtc_remove(struct platform_device *pdev) | |||
| 296 | struct max8925_rtc_info *info = platform_get_drvdata(pdev); | 297 | struct max8925_rtc_info *info = platform_get_drvdata(pdev); |
| 297 | 298 | ||
| 298 | if (info) { | 299 | if (info) { |
| 299 | free_irq(info->chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); | 300 | free_irq(info->irq, info); |
| 300 | rtc_device_unregister(info->rtc_dev); | 301 | rtc_device_unregister(info->rtc_dev); |
| 301 | kfree(info); | 302 | kfree(info); |
| 302 | } | 303 | } |
