From: Axel Lin Date: Wed, 9 Jan 2019 09:30:49 +0000 (+0800) Subject: regulator: twl6030: Use of_device_get_match_data() X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7085180d6a38197c86a9bea84006fa4a4813c7b7;p=android-x86%2Fkernel.git regulator: twl6030: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code a bit. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c index 219cbd910dbf..78b964539775 100644 --- a/drivers/regulator/twl6030-regulator.c +++ b/drivers/regulator/twl6030-regulator.c @@ -687,14 +687,9 @@ static int twlreg_probe(struct platform_device *pdev) struct regulator_init_data *initdata; struct regulation_constraints *c; struct regulator_dev *rdev; - const struct of_device_id *match; struct regulator_config config = { }; - match = of_match_device(twl_of_match, &pdev->dev); - if (!match) - return -ENODEV; - - template = match->data; + template = of_device_get_match_data(&pdev->dev); if (!template) return -ENODEV;