From 948838a10ad24afea3229957b6f02f8587a569e0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 19 Feb 2014 16:35:03 +0800 Subject: regulator: tps65218: Add OF dependency This is a DT-only driver, so make it depend on OF and remove of_match_ptr in the code. Signed-off-by: Axel Lin Acked-by: Keerthy Signed-off-by: Mark Brown --- drivers/regulator/tps65218-regulator.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/regulator/tps65218-regulator.c') diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 1fb1db551ec9..cec72fa71d1d 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c @@ -243,14 +243,12 @@ static int tps65218_regulator_probe(struct platform_device *pdev) int id; match = of_match_device(tps65218_of_match, &pdev->dev); - if (match) { - template = match->data; - id = template->id; - init_data = of_get_regulator_init_data(&pdev->dev, - pdev->dev.of_node); - } else { + if (!match) return -ENODEV; - } + + template = match->data; + id = template->id; + init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node); platform_set_drvdata(pdev, tps); @@ -274,7 +272,7 @@ static struct platform_driver tps65218_regulator_driver = { .driver = { .name = "tps65218-pmic", .owner = THIS_MODULE, - .of_match_table = of_match_ptr(tps65218_of_match), + .of_match_table = tps65218_of_match, }, .probe = tps65218_regulator_probe, }; -- cgit v1.2.3-59-g8ed1b