Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756000Ab3IZHvV (ORCPT ); Thu, 26 Sep 2013 03:51:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:45717 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985Ab3IZHvU (ORCPT ); Thu, 26 Sep 2013 03:51:20 -0400 X-AuditID: cbfee690-b7f3b6d000007a15-75-5243e7769a3a From: Jingoo Han To: "'Mark Brown'" Cc: "'Liam Girdwood'" , linux-kernel@vger.kernel.org, "'Jingoo Han'" , "'Haojian Zhuang'" References: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> In-reply-to: <003101ceba8c$88d6a840$9a83f8c0$%han@samsung.com> Subject: [PATCH V3 08/14] regulator: max8925: use devm_regulator_register() Date: Thu, 26 Sep 2013 16:51:18 +0900 Message-id: <003801ceba8d$2f3bdb10$8db39130$%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+v5Qym5l1DxbvczrwAAJKzw Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOIsWRmVeSWpSXmKPExsVy+t8zQ92y585BBrPuGltMffiEzeLyucOM FpcXXmK1+Halg8ni8q45bA6sHjtn3WX32LSqk83jzrU9bB59W1YxenzeJBfAGsVlk5Kak1mW WqRvl8CVcXfbPeaCKdwVcxqnsDQwLufsYuTgkBAwkbi4R6eLkRPIFJO4cG89WxcjF4eQwDJG iX9NT1khEiYSX9csY4dITGeUWHj6EiOE84tRovH+MxaQKjYBNYkvXw6zg0wVEVCV+P/KHaSG WWAuo8S0xU3sIDVCArYSjd/+gtVzCthJzNp/khnEFhbwlrg44whYDQtQ76UVfWCbeYHqHz57 ygJhC0r8mHwPzGYW0JJYv/M4E4QtL7F5zVtmiG/UJR791QUJiwgYSRxpW8cOUSIise/FO7C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mpwPTFJ5JfGGxiZmRpZGZhZGJubmpAkrifMeaLUOFBJITyxJzU5NLUgtgtnCxMEp 1cB48bUMy701j3N+bl+ce8OPu+LrQVmV11n9L1aZzvzUprsx3f459yYZnnvfO++w1nR/6chx DQ44KVD9OvmdfJHYVb8ZP441nTE+zqdtJP7g23GBVZ0eZrtyGhQ9+8usTZ3ebLy+gnetKHOI B2PS3fdS5bbP/9ytUD7+t6lWIDF3R9bbvCmpV2qUWIozEg21mIuKEwHQHt0RSAMAAA== 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: 1625 Lines: 53 Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han --- drivers/regulator/max8925-regulator.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index d80b5fa..7595107 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c @@ -312,7 +312,7 @@ static int max8925_regulator_probe(struct platform_device *pdev) if (pdata) config.init_data = pdata; - rdev = regulator_register(&ri->desc, &config); + rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "failed to register regulator %s\n", ri->desc.name); @@ -323,22 +323,12 @@ static int max8925_regulator_probe(struct platform_device *pdev) return 0; } -static int max8925_regulator_remove(struct platform_device *pdev) -{ - struct regulator_dev *rdev = platform_get_drvdata(pdev); - - regulator_unregister(rdev); - - return 0; -} - static struct platform_driver max8925_regulator_driver = { .driver = { .name = "max8925-regulator", .owner = THIS_MODULE, }, .probe = max8925_regulator_probe, - .remove = max8925_regulator_remove, }; static int __init max8925_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/