[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <009101ce14af$708aa5d0$519ff170$%han@samsung.com>
Date: Wed, 27 Feb 2013 14:58:17 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Andrew Morton' <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
'Alessandro Zummo' <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com,
'Jonghwa Lee' <jonghwa3.lee@...sung.com>,
'Jingoo Han' <jg1.han@...sung.com>
Subject: [PATCH 3/5] rtc: max77686: use devm_kzalloc()
Use devm_kzalloc() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@...sung.com>
---
drivers/rtc/rtc-max77686.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index 4da2a55..36b1f5c 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -505,7 +505,8 @@ static int max77686_rtc_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "%s\n", __func__);
- info = kzalloc(sizeof(struct max77686_rtc_info), GFP_KERNEL);
+ info = devm_kzalloc(&pdev->dev, sizeof(struct max77686_rtc_info),
+ GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -519,7 +520,6 @@ static int max77686_rtc_probe(struct platform_device *pdev)
ret = PTR_ERR(info->max77686->rtc_regmap);
dev_err(info->max77686->dev, "Failed to allocate register map: %d\n",
ret);
- kfree(info);
return ret;
}
platform_set_drvdata(pdev, info);
@@ -563,11 +563,7 @@ static int max77686_rtc_probe(struct platform_device *pdev)
goto err_rtc;
}
- goto out;
err_rtc:
- kfree(info);
- return ret;
-out:
return ret;
}
@@ -578,7 +574,6 @@ static int max77686_rtc_remove(struct platform_device *pdev)
if (info) {
free_irq(info->virq, info);
rtc_device_unregister(info->rtc_dev);
- kfree(info);
}
return 0;
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists