global: Convert simple_strtoul() with hex to hextoul()
[platform/kernel/u-boot.git] / board / menlo / m53menlo / m53menlo.c
index 70a13aa..2b331b3 100644 (file)
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <init.h>
 #include <malloc.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
@@ -26,6 +27,7 @@
 #include <gzip.h>
 #include <i2c.h>
 #include <ipu_pixfmt.h>
+#include <linux/bitops.h>
 #include <linux/errno.h>
 #include <linux/fb.h>
 #include <mmc.h>
@@ -147,7 +149,7 @@ int board_mmc_getcd(struct mmc *mmc)
 #define SD_PAD_CTRL            (PAD_CTL_HYS | PAD_CTL_PUS_47K_UP | \
                                 PAD_CTL_DSE_HIGH)
 
-int board_mmc_init(bd_t *bis)
+int board_mmc_init(struct bd_info *bis)
 {
        static const iomux_v3_cfg_t sd1_pads[] = {
                NEW_PAD_CTRL(MX53_PAD_SD1_CMD__ESDHC1_CMD, SD_CMD_PAD_CTRL),
@@ -256,7 +258,7 @@ void board_preboot_os(void)
        gpio_direction_output(IMX_GPIO_NR(6, 0), 0);
 }
 
-int ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, struct bd_info *bd)
 {
        if (lvds_compat_string)
                do_fixup_by_path_string(blob, "/panel", "compatible",
@@ -345,31 +347,35 @@ int board_late_init(void)
        if (!s)
                return 0;
 
-       addr = simple_strtoul(s, NULL, 16);
+       addr = hextoul(s, NULL);
        dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE);
        if (!dst)
                return -ENOMEM;
 
        ret = splash_screen_prepare();
        if (ret < 0)
-               return ret;
+               goto splasherr;
 
        len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;
        ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2,
                     (uchar *)addr, &len);
        if (ret) {
                printf("Error: no valid bmp or bmp.gz image at %lx\n", addr);
-               free(dst);
-               return ret;
+               goto splasherr;
        }
 
        ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
        if (ret)
-               return ret;
+               goto splasherr;
 
        ret = video_bmp_display(dev, (ulong)dst + 2, xpos, ypos, true);
        if (ret)
-               return ret;
+               goto splasherr;
+
+       return 0;
+
+splasherr:
+       free(dst);
 #endif
        return 0;
 }