Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756079Ab3IZHwu (ORCPT ); Thu, 26 Sep 2013 03:52:50 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:28209 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054Ab3IZHws (ORCPT ); Thu, 26 Sep 2013 03:52:48 -0400 X-AuditID: cbfee691-b7f4a6d0000074fc-52-5243e7cf7508 From: Jingoo Han To: "'Mark Brown'" Cc: "'Liam Girdwood'" , linux-kernel@vger.kernel.org, "'Jingoo Han'" , "'Linus Walleij'" References: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> In-reply-to: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> Subject: [PATCH V3 11/14] regulator: tps6105x: use devm_regulator_register() Date: Thu, 26 Sep 2013 16:52:46 +0900 Message-id: <003b01ceba8d$63c9aec0$2b5d0c40$%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+v5Qym5l1DxbvczrwAAMdPg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsVy+t8zA93zz52DDBa+0rKY+vAJm8XlhZdY Lb5d6WCymPJnOZPF5V1z2BxYPXbOusvusWlVJ5vHnWt72Dz6tqxi9Pi8SS6ANYrLJiU1J7Ms tUjfLoErY8f6lUwFm3kq/r2dxd7AuI6ri5GTQ0LAROLD5uusELaYxIV769m6GLk4hASWMUr8 X7ePFabo6MN9LBCJ6YwSi1c/ZgNJCAn8YpT48CETxGYTUJP48uUwexcjB4eIgKrE/1fuIPXM AjMZJXb272CCqLeVaPz2lwXE5hSwk5i1/yQziC0s4CPRt34tWJwFqPfnmZtgc3iB6qc2eYKE eQUEJX5MvgdWwiygJbF+53EmCFteYvOat8wg5RIC6hKP/uqChEUEjCTmPL3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KD++qDQntfgQ YzLQnxOZpUST84EJKq8k3tDYxMzI0sjMwsjE3Jw0YSVx3gOt1oFCAumJJanZqakFqUUwW5g4 OKUaGIXi14VcZNJ9910+6vMb7oR5gTcWle7ds6OOd/p02btGt59u5UzLaWHjVdPJeClab/pj l/s1mZYwFcZPdSzrkt2eynDXTLhjsHHWT92t/3bXfP6y4c1TG6nt53+5L1uZtvSoIEtozabD it8v78wRWqzfvnNTc7HY5gX2iq6xzo/b4wMrtCMv/FViKc5INNRiLipOBAB4TQIoRgMAAA== 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: 1783 Lines: 54 Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han --- drivers/regulator/tps6105x-regulator.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c index ec9453f..e0e818d 100644 --- a/drivers/regulator/tps6105x-regulator.c +++ b/drivers/regulator/tps6105x-regulator.c @@ -146,8 +146,9 @@ static int tps6105x_regulator_probe(struct platform_device *pdev) config.driver_data = tps6105x; /* Register regulator with framework */ - tps6105x->regulator = regulator_register(&tps6105x_regulator_desc, - &config); + tps6105x->regulator = devm_regulator_register(&pdev->dev, + &tps6105x_regulator_desc, + &config); if (IS_ERR(tps6105x->regulator)) { ret = PTR_ERR(tps6105x->regulator); dev_err(&tps6105x->client->dev, @@ -159,20 +160,12 @@ static int tps6105x_regulator_probe(struct platform_device *pdev) return 0; } -static int tps6105x_regulator_remove(struct platform_device *pdev) -{ - struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev); - regulator_unregister(tps6105x->regulator); - return 0; -} - static struct platform_driver tps6105x_regulator_driver = { .driver = { .name = "tps6105x-regulator", .owner = THIS_MODULE, }, .probe = tps6105x_regulator_probe, - .remove = tps6105x_regulator_remove, }; static __init int tps6105x_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/