Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756016Ab3IZHvs (ORCPT ); Thu, 26 Sep 2013 03:51:48 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:56747 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007Ab3IZHvq (ORCPT ); Thu, 26 Sep 2013 03:51:46 -0400 X-AuditID: cbfee68d-b7fe86d0000077a5-d8-5243e791f215 From: Jingoo Han To: "'Mark Brown'" Cc: "'Liam Girdwood'" , linux-kernel@vger.kernel.org, "'Jingoo Han'" References: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> In-reply-to: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> Subject: [PATCH V3 09/14] regulator: pcap: use devm_regulator_register() Date: Thu, 26 Sep 2013 16:51:45 +0900 Message-id: <003901ceba8d$3f1467a0$bd3d36e0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac66jIjCzH3ID+v5Qym5l1DxbvczrwAAKhEA Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsVy+t8zQ92Jz52DDKY+k7WY+vAJm8XlhZdY Lb5d6WCyuLxrDpsDi8fOWXfZPTat6mTz6NuyitHj8ya5AJYoLpuU1JzMstQifbsErozDF3vZ Ctq5Kw7tm83WwDiHs4uRk0NCwETi88MmRghbTOLCvfVsXYxcHEICyxglfq85wwJT9LjlCwtE YhGjRNOJm8wgCSGBX4wSN+7Vg9hsAmoSX74cZu9i5OAQEVCV+P/KHcRkFsiV6N6WDlFtK9H4 7S/YSE4BO4lZ+0+CTREW8JA4OuU4WJwFqHP2iy4mkFZeoPoTN2VBwrwCghI/Jt8DK2EW0JJY v/M4E4QtL7F5zVtmkHIJAXWJR391IfYbSSy9rAdRISKx78U7RpDbJQROsUvM/f6aCWKTg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NSRNWEuc90GodKCSQnliSmp2aWpBaBLOFiYNTqoGxLpDd5ecCfgX9b7MC zsUvm3/o9YE7l9aorVde/tz/QoHByvLkpoYDxyetdYoSFEphVN0/v3ffkbyWllcX//G0vHdU e+i1QtvJ+tb+LTniPXz52ct+VF/6y/ZAUmLLjuPvfkxcZ6j87N70tdsD/j2ZzaCUJ33/ys8l ojs+mC6wNAnv8r20fSvrOSWW4oxEQy3mouJEAMtgbbw5AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1611 Lines: 54 Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han --- drivers/regulator/pcap-regulator.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index b49eaee..3727b7d 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c @@ -246,7 +246,8 @@ static int pcap_regulator_probe(struct platform_device *pdev) config.init_data = dev_get_platdata(&pdev->dev); config.driver_data = pcap; - rdev = regulator_register(&pcap_regulators[pdev->id], &config); + rdev = devm_regulator_register(&pdev->dev, &pcap_regulators[pdev->id], + &config); if (IS_ERR(rdev)) return PTR_ERR(rdev); @@ -255,22 +256,12 @@ static int pcap_regulator_probe(struct platform_device *pdev) return 0; } -static int pcap_regulator_remove(struct platform_device *pdev) -{ - struct regulator_dev *rdev = platform_get_drvdata(pdev); - - regulator_unregister(rdev); - - return 0; -} - static struct platform_driver pcap_regulator_driver = { .driver = { .name = "pcap-regulator", .owner = THIS_MODULE, }, .probe = pcap_regulator_probe, - .remove = pcap_regulator_remove, }; static int __init pcap_regulator_init(void) -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/