diff mbox

[U-Boot,04/12] odroid u3: cleanup the regulator calls

Message ID 1431102040-745-5-git-send-email-p.marczak@samsung.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Przemyslaw Marczak May 8, 2015, 4:20 p.m. UTC
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
---
 board/samsung/odroid/odroid.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Simon Glass May 10, 2015, 1:56 p.m. UTC | #1
Hi Przemyslaw,

On 8 May 2015 at 10:20, Przemyslaw Marczak <p.marczak@samsung.com> wrote:
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
> ---
>  board/samsung/odroid/odroid.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
> index 29de325..32155f1 100644
> --- a/board/samsung/odroid/odroid.c
> +++ b/board/samsung/odroid/odroid.c
> @@ -37,6 +37,7 @@ static const char *mmc_regulators[] = {
>         "VDDQ_EMMC_1.8V",
>         "VDDQ_EMMC_2.8V",
>         "TFLASH_2.8V",
> +       NULL,
>  };
>
>  void set_board_type(void)
> @@ -427,9 +428,7 @@ int exynos_init(void)
>
>  int exynos_power_init(void)
>  {
> -       int list_count = ARRAY_SIZE(mmc_regulators);
> -
> -       if (regulator_list_autoset(mmc_regulators, list_count, NULL, true))
> +       if (regulator_list_autoset(mmc_regulators, NULL, true))
>                 error("Unable to init all mmc regulators");
>
>         return 0;
> @@ -441,7 +440,7 @@ static int s5pc210_phy_control(int on)
>         struct udevice *dev;
>         int ret;
>
> -       ret = regulator_by_platname("VDD_UOTG_3.0V", &dev);
> +       ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev);
>         if (ret) {
>                 error("Regulator get error: %d", ret);
>                 return ret;
> @@ -487,7 +486,7 @@ int board_usb_init(int index, enum usb_init_type init)
>         /* Power off and on BUCK8 for LAN9730 */
>         debug("LAN9730 - Turning power buck 8 OFF and ON.\n");
>
> -       ret = regulator_by_platname("VCC_P3V3_2.85V", &dev);
> +       ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev);
>         if (ret) {
>                 error("Regulator get error: %d", ret);
>                 return ret;
> --
> 1.9.1
>

This patch might need to be merged with the one that changes the
function signature, to avoid build errors. Or you could move the
CONFIG enable patch later in the stack perhaps?

Regards,
Simon
diff mbox

Patch

diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index 29de325..32155f1 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -37,6 +37,7 @@  static const char *mmc_regulators[] = {
 	"VDDQ_EMMC_1.8V",
 	"VDDQ_EMMC_2.8V",
 	"TFLASH_2.8V",
+	NULL,
 };
 
 void set_board_type(void)
@@ -427,9 +428,7 @@  int exynos_init(void)
 
 int exynos_power_init(void)
 {
-	int list_count = ARRAY_SIZE(mmc_regulators);
-
-	if (regulator_list_autoset(mmc_regulators, list_count, NULL, true))
+	if (regulator_list_autoset(mmc_regulators, NULL, true))
 		error("Unable to init all mmc regulators");
 
 	return 0;
@@ -441,7 +440,7 @@  static int s5pc210_phy_control(int on)
 	struct udevice *dev;
 	int ret;
 
-	ret = regulator_by_platname("VDD_UOTG_3.0V", &dev);
+	ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev);
 	if (ret) {
 		error("Regulator get error: %d", ret);
 		return ret;
@@ -487,7 +486,7 @@  int board_usb_init(int index, enum usb_init_type init)
 	/* Power off and on BUCK8 for LAN9730 */
 	debug("LAN9730 - Turning power buck 8 OFF and ON.\n");
 
-	ret = regulator_by_platname("VCC_P3V3_2.85V", &dev);
+	ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev);
 	if (ret) {
 		error("Regulator get error: %d", ret);
 		return ret;