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>
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;
int ret;
- if (!needs_init)
- return 0;
-
ret = pmic_bus_init();
if (ret)
return ret;
if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17))
return -ENODEV;
- needs_init = 0;
return 0;
}