[PATCH] rtc: tps65910: Use platform_get_irq to get RTC irq details

From: Venu Byravarasu
Date: Fri Sep 21 2012 - 07:00:45 EST


As RTC driver needs only irq number from platform data,
using platform_get_irq(), instead of generic dev_get_platdata().

Signed-off-by: Venu Byravarasu <vbyravarasu@xxxxxxxxxx>
---
drivers/rtc/rtc-tps65910.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index 691ab96..e3ffae0 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -226,7 +226,6 @@ static int __devinit tps65910_rtc_probe(struct platform_device *pdev)
{
struct tps65910 *tps65910 = NULL;
struct tps65910_rtc *tps_rtc = NULL;
- struct tps65910_board *pmic_plat_data;
int ret;
int irq;
u32 rtc_reg;
@@ -247,28 +246,27 @@ static int __devinit tps65910_rtc_probe(struct platform_device *pdev)
if (ret < 0)
return ret;

- dev_dbg(&pdev->dev, "Enabling rtc-tps65910.\n");
+ dev_dbg(&pdev->dev, "Enabling tps65910 rtc.\n");
rtc_reg = TPS65910_RTC_CTRL_STOP_RTC;
ret = regmap_write(tps65910->regmap, TPS65910_RTC_CTRL, rtc_reg);
if (ret < 0)
return ret;

- pmic_plat_data = dev_get_platdata(tps65910->dev);
- irq = pmic_plat_data->irq_base;
+ irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n",
irq);
return ret;
}

- irq += TPS65910_IRQ_RTC_ALARM;
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
tps65910_rtc_interrupt, IRQF_TRIGGER_LOW,
- "rtc-tps65910", &pdev->dev);
+ "tps65910-rtc", &pdev->dev);
if (ret < 0) {
- dev_err(&pdev->dev, "IRQ is not free.\n");
+ dev_err(&pdev->dev, "IRQ %d is not free.\n", irq);
return ret;
}
+
device_init_wakeup(&pdev->dev, 1);

tps_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
@@ -341,7 +339,7 @@ static struct platform_driver tps65910_rtc_driver = {
.remove = __devexit_p(tps65910_rtc_remove),
.driver = {
.owner = THIS_MODULE,
- .name = "rtc-tps65910",
+ .name = "tps65910-rtc",
.pm = DEV_PM_OPS,
},
};
--
1.7.1.1

--
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/