diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-01-03 01:31:57 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-03 06:28:52 -0500 |
commit | 38d8f67cb6f6d40dd9473a972ec65b3d54a785dd (patch) | |
tree | d24c58fb09d6bd12998dc90d0caccda65282444b | |
parent | 3b0e8f128190982e2a8872e208723de09538e36b (diff) |
lp8788-buck: fix a parent device on devm_gpio_request()
Use 'platform_device' rather than i2c client device node.
Arguments are added in lp8788_init_dvs() and lp8788_dvs_gpio_request().
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/regulator/lp8788-buck.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c index 4916a55d4d6f..98770e8b2e54 100644 --- a/drivers/regulator/lp8788-buck.c +++ b/drivers/regulator/lp8788-buck.c | |||
@@ -429,7 +429,8 @@ static struct regulator_desc lp8788_buck_desc[] = { | |||
429 | }, | 429 | }, |
430 | }; | 430 | }; |
431 | 431 | ||
432 | static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, | 432 | static int lp8788_dvs_gpio_request(struct platform_device *pdev, |
433 | struct lp8788_buck *buck, | ||
433 | enum lp8788_buck_id id) | 434 | enum lp8788_buck_id id) |
434 | { | 435 | { |
435 | struct lp8788_platform_data *pdata = buck->lp->pdata; | 436 | struct lp8788_platform_data *pdata = buck->lp->pdata; |
@@ -440,7 +441,7 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, | |||
440 | switch (id) { | 441 | switch (id) { |
441 | case BUCK1: | 442 | case BUCK1: |
442 | gpio = pdata->buck1_dvs->gpio; | 443 | gpio = pdata->buck1_dvs->gpio; |
443 | ret = devm_gpio_request_one(buck->lp->dev, gpio, DVS_LOW, | 444 | ret = devm_gpio_request_one(&pdev->dev, gpio, DVS_LOW, |
444 | b1_name); | 445 | b1_name); |
445 | if (ret) | 446 | if (ret) |
446 | return ret; | 447 | return ret; |
@@ -450,7 +451,7 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, | |||
450 | case BUCK2: | 451 | case BUCK2: |
451 | for (i = 0 ; i < LP8788_NUM_BUCK2_DVS ; i++) { | 452 | for (i = 0 ; i < LP8788_NUM_BUCK2_DVS ; i++) { |
452 | gpio = pdata->buck2_dvs->gpio[i]; | 453 | gpio = pdata->buck2_dvs->gpio[i]; |
453 | ret = devm_gpio_request_one(buck->lp->dev, gpio, | 454 | ret = devm_gpio_request_one(&pdev->dev, gpio, |
454 | DVS_LOW, b2_name[i]); | 455 | DVS_LOW, b2_name[i]); |
455 | if (ret) | 456 | if (ret) |
456 | return ret; | 457 | return ret; |
@@ -464,7 +465,8 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, | |||
464 | return 0; | 465 | return 0; |
465 | } | 466 | } |
466 | 467 | ||
467 | static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id) | 468 | static int lp8788_init_dvs(struct platform_device *pdev, |
469 | struct lp8788_buck *buck, enum lp8788_buck_id id) | ||
468 | { | 470 | { |
469 | struct lp8788_platform_data *pdata = buck->lp->pdata; | 471 | struct lp8788_platform_data *pdata = buck->lp->pdata; |
470 | u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M }; | 472 | u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M }; |
@@ -483,7 +485,7 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id) | |||
483 | (id == BUCK2 && !pdata->buck2_dvs)) | 485 | (id == BUCK2 && !pdata->buck2_dvs)) |
484 | goto set_default_dvs_mode; | 486 | goto set_default_dvs_mode; |
485 | 487 | ||
486 | if (lp8788_dvs_gpio_request(buck, id)) | 488 | if (lp8788_dvs_gpio_request(pdev, buck, id)) |
487 | goto set_default_dvs_mode; | 489 | goto set_default_dvs_mode; |
488 | 490 | ||
489 | return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id], | 491 | return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id], |
@@ -509,7 +511,7 @@ static int lp8788_buck_probe(struct platform_device *pdev) | |||
509 | 511 | ||
510 | buck->lp = lp; | 512 | buck->lp = lp; |
511 | 513 | ||
512 | ret = lp8788_init_dvs(buck, id); | 514 | ret = lp8788_init_dvs(pdev, buck, id); |
513 | if (ret) | 515 | if (ret) |
514 | return ret; | 516 | return ret; |
515 | 517 | ||