aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@marvell.com>2017-07-20 04:42:17 -0400
committerMark Brown <broonie@kernel.org>2017-07-20 07:19:19 -0400
commitd110e3e921742980a54c27f16086dc5a6c1aecd7 (patch)
tree31e31d13ed5c861f1a9e2cf4fdb18242e15895fc
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff)
regulator: fan53555: Use of_device_get_match_data() to simplify probe
if fan53555_regulator_probe() is called and the "client->dev.of_node" isn't NULL, it means OF registered a device with a valid compatible string, so match cannot be NULL. Use of_device_get_match_data() to retrieve the drvdata pointer. No functional change intended. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/fan53555.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 60f431831582..6b1c0e4672a2 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -407,14 +407,8 @@ static int fan53555_regulator_probe(struct i2c_client *client,
407 407
408 di->regulator = pdata->regulator; 408 di->regulator = pdata->regulator;
409 if (client->dev.of_node) { 409 if (client->dev.of_node) {
410 const struct of_device_id *match; 410 di->vendor =
411 411 (unsigned long)of_device_get_match_data(&client->dev);
412 match = of_match_device(of_match_ptr(fan53555_dt_ids),
413 &client->dev);
414 if (!match)
415 return -ENODEV;
416
417 di->vendor = (unsigned long) match->data;
418 } else { 412 } else {
419 /* if no ramp constraint set, get the pdata ramp_delay */ 413 /* if no ramp constraint set, get the pdata ramp_delay */
420 if (!di->regulator->constraints.ramp_delay) { 414 if (!di->regulator->constraints.ramp_delay) {