From: Mark Brown Date: Sat, 31 Aug 2013 10:59:57 +0000 (+0100) Subject: regulator: wm831x-isink: Convert to devm_regulator_register() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=af151ded1b4b22dbedd8cb1600fcaf72e3eaf31e;p=linux-beck.git regulator: wm831x-isink: Convert to devm_regulator_register() Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 841cb52b2bb6..0339b886df5d 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c @@ -194,7 +194,8 @@ static int wm831x_isink_probe(struct platform_device *pdev) config.init_data = pdata->isink[id]; config.driver_data = isink; - isink->regulator = regulator_register(&isink->desc, &config); + isink->regulator = devm_regulator_register(&pdev->dev, &isink->desc, + &config); if (IS_ERR(isink->regulator)) { ret = PTR_ERR(isink->regulator); dev_err(wm831x->dev, "Failed to register ISINK%d: %d\n", @@ -210,31 +211,19 @@ static int wm831x_isink_probe(struct platform_device *pdev) if (ret != 0) { dev_err(&pdev->dev, "Failed to request ISINK IRQ %d: %d\n", irq, ret); - goto err_regulator; + goto err; } platform_set_drvdata(pdev, isink); return 0; -err_regulator: - regulator_unregister(isink->regulator); err: return ret; } -static int wm831x_isink_remove(struct platform_device *pdev) -{ - struct wm831x_isink *isink = platform_get_drvdata(pdev); - - regulator_unregister(isink->regulator); - - return 0; -} - static struct platform_driver wm831x_isink_driver = { .probe = wm831x_isink_probe, - .remove = wm831x_isink_remove, .driver = { .name = "wm831x-isink", .owner = THIS_MODULE,