diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/tps6507x-regulator.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 23c0597ab1f5..c3f1bf822fd0 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -489,6 +489,7 @@ static int __devinit tps_6507x_probe(struct i2c_client *client, | |||
489 | struct regulator_init_data *init_data; | 489 | struct regulator_init_data *init_data; |
490 | struct regulator_dev *rdev; | 490 | struct regulator_dev *rdev; |
491 | struct tps_pmic *tps; | 491 | struct tps_pmic *tps; |
492 | struct tps6507x_board *tps_board; | ||
492 | int i; | 493 | int i; |
493 | int error; | 494 | int error; |
494 | 495 | ||
@@ -497,12 +498,21 @@ static int __devinit tps_6507x_probe(struct i2c_client *client, | |||
497 | return -EIO; | 498 | return -EIO; |
498 | 499 | ||
499 | /** | 500 | /** |
501 | * tps_board points to pmic related constants | ||
502 | * coming from the board-evm file. | ||
503 | */ | ||
504 | |||
505 | tps_board = dev_get_platdata(&client->dev); | ||
506 | if (!tps_board) | ||
507 | return -EINVAL; | ||
508 | |||
509 | /** | ||
500 | * init_data points to array of regulator_init structures | 510 | * init_data points to array of regulator_init structures |
501 | * coming from the board-evm file. | 511 | * coming from the board-evm file. |
502 | */ | 512 | */ |
503 | init_data = client->dev.platform_data; | 513 | init_data = tps_board->tps6507x_pmic_init_data; |
504 | if (!init_data) | 514 | if (!init_data) |
505 | return -EIO; | 515 | return -EINVAL; |
506 | 516 | ||
507 | tps = kzalloc(sizeof(*tps), GFP_KERNEL); | 517 | tps = kzalloc(sizeof(*tps), GFP_KERNEL); |
508 | if (!tps) | 518 | if (!tps) |