ARM: pxa: propagate errors from regulator_enable() to pxamci

The em_x270_mci_setpower() and em_x270_usb_hub_init() functions
call regulator_enable(), which may return an error that must
be checked.

This changes the em_x270_usb_hub_init() function to bail out
if it fails, and changes the pxamci_platform_data->setpower
callback so that the a failed em_x270_mci_setpower call
can be propagated by the pxamci driver into the mmc core.

Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Acked-by: Chris Ball <[email protected]>
[olof: fixed order of regulator_enable() and test in em_x270_usb_hub_init]
Signed-off-by: Olof Johansson <[email protected]>
This commit is contained in:
Arnd Bergmann 2013-07-05 17:51:20 +02:00 • committed by Olof Johansson
commit a829abf8da
8 changed files with 27 additions and 11 deletions

View file

@ -128,7 +128,7 @@ static inline int pxamci_set_power(struct pxamci_host *host,
!!on ^ host->pdata->gpio_power_invert);
}
if (!host->vcc && host->pdata && host->pdata->setpower)
host->pdata->setpower(mmc_dev(host->mmc), vdd);
return host->pdata->setpower(mmc_dev(host->mmc), vdd);
return 0;
}