mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 21:54:37 +08:00
sunxi: power: Drop protection against multiple calls from axp221 axp_init()
The only thing axp221.c's axp_init() does which needs protection against multiple calls is calling pmic_bus_init, and pmic_bus_init() itself is already protected against being called multiple times. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
parent
30490b528b
commit
03f8ae3719
@ -269,14 +269,9 @@ int axp_set_eldo(int eldo_num, unsigned int mvolt)
|
|||||||
|
|
||||||
int axp_init(void)
|
int axp_init(void)
|
||||||
{
|
{
|
||||||
/* This cannot be 0 because it is used in SPL before BSS is ready */
|
|
||||||
static int needs_init = 1;
|
|
||||||
u8 axp_chip_id;
|
u8 axp_chip_id;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!needs_init)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ret = pmic_bus_init();
|
ret = pmic_bus_init();
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -288,7 +283,6 @@ int axp_init(void)
|
|||||||
if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17))
|
if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
needs_init = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user