* [merged] rtc-rtc-pm8xxx-use-devm_-functions.patch removed from -mm tree
@ 2013-07-08 19:33 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2013-07-08 19:33 UTC (permalink / raw)
To: mm-commits, jg1.han
Subject: [merged] rtc-rtc-pm8xxx-use-devm_-functions.patch removed from -mm tree
To: jg1.han@samsung.com,mm-commits@vger.kernel.org
From: akpm@linux-foundation.org
Date: Mon, 08 Jul 2013 12:33:30 -0700
The patch titled
Subject: rtc: rtc-pm8xxx: use devm_*() functions
has been removed from the -mm tree. Its filename was
rtc-rtc-pm8xxx-use-devm_-functions.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Jingoo Han <jg1.han@samsung.com>
Subject: rtc: rtc-pm8xxx: use devm_*() functions
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/rtc/rtc-pm8xxx.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff -puN drivers/rtc/rtc-pm8xxx.c~rtc-rtc-pm8xxx-use-devm_-functions drivers/rtc/rtc-pm8xxx.c
--- a/drivers/rtc/rtc-pm8xxx.c~rtc-rtc-pm8xxx-use-devm_-functions
+++ a/drivers/rtc/rtc-pm8xxx.c
@@ -395,7 +395,7 @@ static int pm8xxx_rtc_probe(struct platf
if (pdata != NULL)
rtc_write_enable = pdata->rtc_write_enable;
- rtc_dd = kzalloc(sizeof(*rtc_dd), GFP_KERNEL);
+ rtc_dd = devm_kzalloc(&pdev->dev, sizeof(*rtc_dd), GFP_KERNEL);
if (rtc_dd == NULL) {
dev_err(&pdev->dev, "Unable to allocate memory!\n");
return -ENOMEM;
@@ -407,16 +407,14 @@ static int pm8xxx_rtc_probe(struct platf
rtc_dd->rtc_alarm_irq = platform_get_irq(pdev, 0);
if (rtc_dd->rtc_alarm_irq < 0) {
dev_err(&pdev->dev, "Alarm IRQ resource absent!\n");
- rc = -ENXIO;
- goto fail_rtc_enable;
+ return -ENXIO;
}
rtc_resource = platform_get_resource_byname(pdev, IORESOURCE_IO,
"pmic_rtc_base");
if (!(rtc_resource && rtc_resource->start)) {
dev_err(&pdev->dev, "RTC IO resource absent!\n");
- rc = -ENXIO;
- goto fail_rtc_enable;
+ return -ENXIO;
}
rtc_dd->rtc_base = rtc_resource->start;
@@ -432,7 +430,7 @@ static int pm8xxx_rtc_probe(struct platf
rc = pm8xxx_read_wrapper(rtc_dd, &ctrl_reg, rtc_dd->rtc_base, 1);
if (rc < 0) {
dev_err(&pdev->dev, "RTC control register read failed!\n");
- goto fail_rtc_enable;
+ return rc;
}
if (!(ctrl_reg & PM8xxx_RTC_ENABLE)) {
@@ -442,7 +440,7 @@ static int pm8xxx_rtc_probe(struct platf
if (rc < 0) {
dev_err(&pdev->dev, "Write to RTC control register "
"failed\n");
- goto fail_rtc_enable;
+ return rc;
}
}
@@ -453,13 +451,12 @@ static int pm8xxx_rtc_probe(struct platf
platform_set_drvdata(pdev, rtc_dd);
/* Register the RTC device */
- rtc_dd->rtc = rtc_device_register("pm8xxx_rtc", &pdev->dev,
+ rtc_dd->rtc = devm_rtc_device_register(&pdev->dev, "pm8xxx_rtc",
&pm8xxx_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc_dd->rtc)) {
dev_err(&pdev->dev, "%s: RTC registration failed (%ld)\n",
__func__, PTR_ERR(rtc_dd->rtc));
- rc = PTR_ERR(rtc_dd->rtc);
- goto fail_rtc_enable;
+ return PTR_ERR(rtc_dd->rtc);
}
/* Request the alarm IRQ */
@@ -468,7 +465,7 @@ static int pm8xxx_rtc_probe(struct platf
"pm8xxx_rtc_alarm", rtc_dd);
if (rc < 0) {
dev_err(&pdev->dev, "Request IRQ failed (%d)\n", rc);
- goto fail_req_irq;
+ return rc;
}
device_init_wakeup(&pdev->dev, 1);
@@ -476,12 +473,6 @@ static int pm8xxx_rtc_probe(struct platf
dev_dbg(&pdev->dev, "Probe success !!\n");
return 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-08 19:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08 19:33 [merged] rtc-rtc-pm8xxx-use-devm_-functions.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.