From: Hans de Goede Date: Sat, 3 Oct 2015 16:26:23 +0200 Subject: [U-Boot] [PATCH 7/7] sunxi: power: Drop protection against multiple calls from axp221 axp_init() In-Reply-To: <1443882383-21181-1-git-send-email-hdegoede@redhat.com> References: <1443882383-21181-1-git-send-email-hdegoede@redhat.com> Message-ID: <1443882383-21181-7-git-send-email-hdegoede@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/power/axp221.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c index d621f2a..65802e4 100644 --- a/drivers/power/axp221.c +++ b/drivers/power/axp221.c @@ -269,14 +269,9 @@ int axp_set_eldo(int eldo_num, unsigned int mvolt) 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; @@ -288,7 +283,6 @@ int axp_init(void) if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17)) return -ENODEV; - needs_init = 0; return 0; } -- 2.5.0