aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-01 11:17:11 +0100
committerMark Brown <broonie@linaro.org>2013-07-01 11:17:11 +0100
commit70083c4c8c60d9ddc188f51e0960574badc919af (patch)
treeb658f08cedfe7b8b4b47f3941748b143085071bd /drivers/regulator
parentMerge remote-tracking branch 'regulator/topic/of' into regulator-next (diff)
parentregulator: tps62360: Fix crash in i2c_driver .probe (diff)
downloadlinux-dev-70083c4c8c60d9ddc188f51e0960574badc919af.tar.xz
linux-dev-70083c4c8c60d9ddc188f51e0960574badc919af.zip
Merge remote-tracking branch 'regulator/topic/tps62360' into regulator-next
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps62360-regulator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index 612919c3081c..a490d5b749b2 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -351,7 +351,6 @@ static int tps62360_probe(struct i2c_client *client,
int chip_id;
pdata = client->dev.platform_data;
- chip_id = id->driver_data;
if (client->dev.of_node) {
const struct of_device_id *match;
@@ -364,6 +363,11 @@ static int tps62360_probe(struct i2c_client *client,
chip_id = (int)match->data;
if (!pdata)
pdata = of_get_tps62360_platform_data(&client->dev);
+ } else if (id) {
+ chip_id = id->driver_data;
+ } else {
+ dev_err(&client->dev, "No device tree match or id table match found\n");
+ return -ENODEV;
}
if (!pdata) {
@@ -402,7 +406,7 @@ static int tps62360_probe(struct i2c_client *client,
return -ENODEV;
}
- tps->desc.name = id->name;
+ tps->desc.name = client->name;
tps->desc.id = 0;
tps->desc.ops = &tps62360_dcdc_ops;
tps->desc.type = REGULATOR_VOLTAGE;