aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-max8998.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 22:47:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 22:47:50 -0400
commit56847d857cb0c3ee78c22ce776a26f88d9ffd4d4 (patch)
treea85bcf204a53e45d26f6a3984f16ddd525eef3e7 /drivers/rtc/rtc-max8998.c
parent191a712090bb8a10e6f129360eeed2d68f3d4c9a (diff)
parent8d564368a9a3197f43e56dadf4a18c5738849f94 (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge second batch of fixes from Andrew Morton: - various misc bits - some printk updates - a new "SRAM" driver. - MAINTAINERS updates - the backlight driver queue - checkpatch updates - a few init/ changes - a huge number of drivers/rtc changes - fatfs updates - some lib/idr.c work - some renaming of the random driver interfaces * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (285 commits) net: rename random32 to prandom net/core: remove duplicate statements by do-while loop net/core: rename random32() to prandom_u32() net/netfilter: rename random32() to prandom_u32() net/sched: rename random32() to prandom_u32() net/sunrpc: rename random32() to prandom_u32() scsi: rename random32() to prandom_u32() lguest: rename random32() to prandom_u32() uwb: rename random32() to prandom_u32() video/uvesafb: rename random32() to prandom_u32() mmc: rename random32() to prandom_u32() drbd: rename random32() to prandom_u32() kernel/: rename random32() to prandom_u32() mm/: rename random32() to prandom_u32() lib/: rename random32() to prandom_u32() x86: rename random32() to prandom_u32() x86: pageattr-test: remove srandom32 call uuid: use prandom_bytes() raid6test: use prandom_bytes() sctp: convert sctp_assoc_set_id() to use idr_alloc_cyclic() ...
Diffstat (limited to 'drivers/rtc/rtc-max8998.c')
-rw-r--r--drivers/rtc/rtc-max8998.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index 8f234a075e8f..48b6612fae7f 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -256,7 +256,8 @@ static int max8998_rtc_probe(struct platform_device *pdev)
256 struct max8998_rtc_info *info; 256 struct max8998_rtc_info *info;
257 int ret; 257 int ret;
258 258
259 info = kzalloc(sizeof(struct max8998_rtc_info), GFP_KERNEL); 259 info = devm_kzalloc(&pdev->dev, sizeof(struct max8998_rtc_info),
260 GFP_KERNEL);
260 if (!info) 261 if (!info)
261 return -ENOMEM; 262 return -ENOMEM;
262 263
@@ -267,7 +268,7 @@ static int max8998_rtc_probe(struct platform_device *pdev)
267 268
268 platform_set_drvdata(pdev, info); 269 platform_set_drvdata(pdev, info);
269 270
270 info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev, 271 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8998-rtc",
271 &max8998_rtc_ops, THIS_MODULE); 272 &max8998_rtc_ops, THIS_MODULE);
272 273
273 if (IS_ERR(info->rtc_dev)) { 274 if (IS_ERR(info->rtc_dev)) {
@@ -276,8 +277,8 @@ static int max8998_rtc_probe(struct platform_device *pdev)
276 goto out_rtc; 277 goto out_rtc;
277 } 278 }
278 279
279 ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0, 280 ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL,
280 "rtc-alarm0", info); 281 max8998_rtc_alarm_irq, 0, "rtc-alarm0", info);
281 282
282 if (ret < 0) 283 if (ret < 0)
283 dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", 284 dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
@@ -294,20 +295,11 @@ static int max8998_rtc_probe(struct platform_device *pdev)
294 295
295out_rtc: 296out_rtc:
296 platform_set_drvdata(pdev, NULL); 297 platform_set_drvdata(pdev, NULL);
297 kfree(info);
298 return ret; 298 return ret;
299} 299}
300 300
301static int max8998_rtc_remove(struct platform_device *pdev) 301static int max8998_rtc_remove(struct platform_device *pdev)
302{ 302{
303 struct max8998_rtc_info *info = platform_get_drvdata(pdev);
304
305 if (info) {
306 free_irq(info->irq, info);
307 rtc_device_unregister(info->rtc_dev);
308 kfree(info);
309 }
310
311 return 0; 303 return 0;
312} 304}
313 305