diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index f1624ff..6eb7f9c 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -565,28 +565,28 @@
 	if (!p)
 		return;
 
-	pclassfw = (void *)simple_strtoul(p, NULL, 16);
+	pclassfw = (void *)hextoul(p, NULL);
 	if (!pclassfw)
 		return;
 
 	p = env_get("class_elf_size");
 	if (!p)
 		return;
-	len_class = simple_strtoul(p, NULL, 16);
+	len_class = hextoul(p, NULL);
 
 	/* If the environment variable is not set, then exit silently */
 	p = env_get("tmu_elf_firmware");
 	if (!p)
 		return;
 
-	ptmufw = (void *)simple_strtoul(p, NULL, 16);
+	ptmufw = (void *)hextoul(p, NULL);
 	if (!ptmufw)
 		return;
 
 	p = env_get("tmu_elf_size");
 	if (!p)
 		return;
-	len_tmu = simple_strtoul(p, NULL, 16);
+	len_tmu = hextoul(p, NULL);
 
 	if (len_class == 0 || len_tmu == 0) {
 		printf("PFE FW corrupted. CLASS FW size %d, TMU FW size %d\n",
@@ -605,14 +605,14 @@
 	if (!p)
 		return;
 
-	putilfw = (void *)simple_strtoul(p, NULL, 16);
+	putilfw = (void *)hextoul(p, NULL);
 	if (!putilfw)
 		return;
 
 	p = env_get("util_elf_size");
 	if (!p)
 		return;
-	len_util = simple_strtoul(p, NULL, 16);
+	len_util = hextoul(p, NULL);
 
 	if (len_util) {
 		printf("PFE Util PE firmware is not added to FDT.\n");
diff --git a/arch/arm/lib/semihosting.c b/arch/arm/lib/semihosting.c
index 904fddd..9fd8245 100644
--- a/arch/arm/lib/semihosting.c
+++ b/arch/arm/lib/semihosting.c
@@ -191,7 +191,7 @@
 		int ret;
 		char end_str[64];
 
-		load_addr = simple_strtoul(argv[2], NULL, 16);
+		load_addr = hextoul(argv[2], NULL);
 		if (!load_addr)
 			return -1;
 
diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
index b10ead1..40df10d 100644
--- a/arch/arm/mach-imx/cmd_dek.c
+++ b/arch/arm/mach-imx/cmd_dek.c
@@ -300,8 +300,8 @@
 	if (argc != 4)
 		return CMD_RET_USAGE;
 
-	src_addr = simple_strtoul(argv[1], NULL, 16);
-	dst_addr = simple_strtoul(argv[2], NULL, 16);
+	src_addr = hextoul(argv[1], NULL);
+	dst_addr = hextoul(argv[2], NULL);
 	len = simple_strtoul(argv[3], NULL, 10);
 
 	return blob_encap_dek(src_addr, dst_addr, len);
diff --git a/arch/arm/mach-imx/cmd_mfgprot.c b/arch/arm/mach-imx/cmd_mfgprot.c
index 1430f61..29074fc 100644
--- a/arch/arm/mach-imx/cmd_mfgprot.c
+++ b/arch/arm/mach-imx/cmd_mfgprot.c
@@ -71,7 +71,7 @@
 		if (argc != 4)
 			return CMD_RET_USAGE;
 
-		m_addr = simple_strtoul(argv[2], NULL, 16);
+		m_addr = hextoul(argv[2], NULL);
 		m_size = simple_strtoul(argv[3], NULL, 10);
 		m_ptr = map_physmem(m_addr, m_size, MAP_NOCACHE);
 		if (!m_ptr)
diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 7157c9e..cd51344 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -1083,13 +1083,13 @@
 
 	mtd = cfg.mtd;
 
-	cfg.boot_stream1_address = simple_strtoul(argv[2], NULL, 16);
-	cfg.boot_stream1_size = simple_strtoul(argv[3], NULL, 16);
+	cfg.boot_stream1_address = hextoul(argv[2], NULL);
+	cfg.boot_stream1_size = hextoul(argv[3], NULL);
 	cfg.boot_stream1_size = ALIGN(cfg.boot_stream1_size, mtd->writesize);
 
 	if (argc > 5) {
-		cfg.boot_stream2_address = simple_strtoul(argv[4], NULL, 16);
-		cfg.boot_stream2_size = simple_strtoul(argv[5], NULL, 16);
+		cfg.boot_stream2_address = hextoul(argv[4], NULL);
+		cfg.boot_stream2_size = hextoul(argv[5], NULL);
 		cfg.boot_stream2_size = ALIGN(cfg.boot_stream2_size,
 					      mtd->writesize);
 	}
@@ -1450,7 +1450,7 @@
 	if (nandbcb_set_boot_config(argc, argv, &cfg))
 		return CMD_RET_FAILURE;
 
-	addr = simple_strtoul(argv[1], &endp, 16);
+	addr = hextoul(argv[1], &endp);
 	if (*argv[1] == 0 || *endp != 0)
 		return CMD_RET_FAILURE;
 
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 00bd157..cc39e6b 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -609,12 +609,12 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
-	length = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[1], NULL);
+	length = hextoul(argv[2], NULL);
 	if (argc == 3)
 		ivt_offset = get_image_ivt_offset(addr);
 	else
-		ivt_offset = simple_strtoul(argv[3], NULL, 16);
+		ivt_offset = hextoul(argv[3], NULL);
 
 	rcode = imx_hab_authenticate_image(addr, length, ivt_offset);
 	if (rcode == 0)
diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c
index 6392fe2..015267c 100644
--- a/arch/arm/mach-imx/imx8/ahab.c
+++ b/arch/arm/mach-imx/imx8/ahab.c
@@ -161,7 +161,7 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	printf("Authenticate OS container at 0x%lx\n", addr);
 
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c
index 6f9b1c9..7c34ce6 100644
--- a/arch/arm/mach-imx/imx8/snvs_security_sc.c
+++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c
@@ -638,24 +638,24 @@
 	if (argc != (NB_REGISTERS + 1))
 		return CMD_RET_USAGE;
 
-	conf.hp.lock = simple_strtoul(argv[++idx], NULL, 16);
-	conf.hp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.lock = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_filt_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_det_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_det_cfg2 = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_filt1_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_filt2_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper1_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper2_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper3_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper4_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper5_cfg = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper_clk_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper_routing_ctl1 = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.act_tamper_routing_ctl2 = simple_strtoul(argv[++idx], NULL, 16);
+	conf.hp.lock = hextoul(argv[++idx], NULL);
+	conf.hp.secvio_ctl = hextoul(argv[++idx], NULL);
+	conf.lp.lock = hextoul(argv[++idx], NULL);
+	conf.lp.secvio_ctl = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_filt_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_det_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_det_cfg2 = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_filt1_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_filt2_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper1_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper2_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper3_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper4_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper5_cfg = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper_ctl = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper_clk_ctl = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper_routing_ctl1 = hextoul(argv[++idx], NULL);
+	conf.lp.act_tamper_routing_ctl2 = hextoul(argv[++idx], NULL);
 
 	err = apply_snvs_config(&conf);
 
@@ -690,12 +690,12 @@
 	if (argc != (6 + 1))
 		return CMD_RET_USAGE;
 
-	conf.tamper_offset_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.tamper_pull_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.tamper_ana_test_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.tamper_sensor_trim_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.tamper_misc_ctl = simple_strtoul(argv[++idx], NULL, 16);
-	conf.tamper_core_volt_mon_ctl = simple_strtoul(argv[++idx], NULL, 16);
+	conf.tamper_offset_ctl = hextoul(argv[++idx], NULL);
+	conf.tamper_pull_ctl = hextoul(argv[++idx], NULL);
+	conf.tamper_ana_test_ctl = hextoul(argv[++idx], NULL);
+	conf.tamper_sensor_trim_ctl = hextoul(argv[++idx], NULL);
+	conf.tamper_misc_ctl = hextoul(argv[++idx], NULL);
+	conf.tamper_core_volt_mon_ctl = hextoul(argv[++idx], NULL);
 
 	err = apply_snvs_dgo_config(&conf);
 
@@ -727,7 +727,7 @@
 		return CMD_RET_USAGE;
 
 	conf.pad = simple_strtoul(argv[++idx], NULL, 10);
-	conf.mux_conf = simple_strtoul(argv[++idx], NULL, 16);
+	conf.mux_conf = hextoul(argv[++idx], NULL);
 
 	err = apply_tamper_pin_list_config(&conf, 1);
 
@@ -761,8 +761,8 @@
 	if (argc != (2 + 1))
 		return CMD_RET_USAGE;
 
-	conf.lp.status = simple_strtoul(argv[++idx], NULL, 16);
-	conf.lp.tamper_det_status = simple_strtoul(argv[++idx], NULL, 16);
+	conf.lp.status = hextoul(argv[++idx], NULL);
+	conf.lp.tamper_det_status = hextoul(argv[++idx], NULL);
 
 	scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.status),
 					   &conf.lp.status, NULL, NULL, NULL,
diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
index 30fb45d..9ffe5ac 100644
--- a/arch/arm/mach-imx/imx_bootaux.c
+++ b/arch/arm/mach-imx/imx_bootaux.c
@@ -180,7 +180,7 @@
 		return CMD_RET_SUCCESS;
 	}
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	if (!addr)
 		return CMD_RET_FAILURE;
diff --git a/arch/arm/mach-imx/mx6/mp.c b/arch/arm/mach-imx/mx6/mp.c
index 2fdf070..de9ace0 100644
--- a/arch/arm/mach-imx/mx6/mp.c
+++ b/arch/arm/mach-imx/mx6/mp.c
@@ -47,7 +47,7 @@
 {
 	uint32_t boot_addr;
 
-	boot_addr = simple_strtoul(argv[0], NULL, 16);
+	boot_addr = hextoul(argv[0], NULL);
 
 	switch (nr) {
 	case 1:
diff --git a/arch/arm/mach-keystone/cmd_mon.c b/arch/arm/mach-keystone/cmd_mon.c
index 049d573..e26296b 100644
--- a/arch/arm/mach-keystone/cmd_mon.c
+++ b/arch/arm/mach-keystone/cmd_mon.c
@@ -25,7 +25,7 @@
 
 	freq = CONFIG_SYS_HZ_CLOCK;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	header = (struct image_header *)addr;
 
@@ -40,7 +40,7 @@
 	       size);
 
 	if (argc >=  3)
-		ecrypt_bm_addr = simple_strtoul(argv[2], NULL, 16);
+		ecrypt_bm_addr = hextoul(argv[2], NULL);
 
 	rcode = mon_install(load_addr, dpsc_base, freq, ecrypt_bm_addr);
 	printf("## installed monitor @ 0x%x, freq [%d], status %d\n",
@@ -76,8 +76,8 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	core_id = simple_strtoul(argv[1], NULL, 16);
-	on = simple_strtoul(argv[2], NULL, 16);
+	core_id = hextoul(argv[1], NULL);
+	on = hextoul(argv[2], NULL);
 
 	if (on)
 		rcode = mon_power_on(core_id, fn);
diff --git a/arch/arm/mach-snapdragon/misc.c b/arch/arm/mach-snapdragon/misc.c
index aaa561c..985625a 100644
--- a/arch/arm/mach-snapdragon/misc.c
+++ b/arch/arm/mach-snapdragon/misc.c
@@ -47,7 +47,7 @@
 	mac[0] = 0x02;
 	mac[1] = 00;
 	for (i = 3; i >= 0; i--) {
-		mac[i + 2] = simple_strtoul(&sn[2 * i], NULL, 16);
+		mac[i + 2] = hextoul(&sn[2 * i], NULL);
 		sn[2 * i] = 0;
 	}
 }
diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 64a7c9d..f8d3d48 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -191,7 +191,7 @@
 	argv++;
 
 	if (argc == 3)
-		mask = simple_strtoul(argv[1], NULL, 16);
+		mask = hextoul(argv[1], NULL);
 
 	switch (*argv[0]) {
 	case 'e':	/* Enable */
diff --git a/arch/arm/mach-socfpga/vab.c b/arch/arm/mach-socfpga/vab.c
index 85b3f30..e146f2c 100644
--- a/arch/arm/mach-socfpga/vab.c
+++ b/arch/arm/mach-socfpga/vab.c
@@ -17,8 +17,8 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
-	len = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[1], NULL);
+	len = hextoul(argv[2], NULL);
 
 	if (socfpga_vendor_authentication((void *)&addr, (size_t *)&len) != 0)
 		return CMD_RET_FAILURE;
diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c
index 50840b0..68f2892 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32key.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
@@ -162,7 +162,7 @@
 		return CMD_RET_SUCCESS;
 	}
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 	if (!addr)
 		return CMD_RET_USAGE;
 
@@ -185,7 +185,7 @@
 		yes = true;
 	}
 
-	addr = simple_strtoul(argv[argc - 1], NULL, 16);
+	addr = hextoul(argv[argc - 1], NULL);
 	if (!addr)
 		return CMD_RET_USAGE;
 
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index 064f51b..bf9a686 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -64,12 +64,12 @@
 	addr = STM32_DDR_BASE;
 	size = 0;
 	if (argc > 3) {
-		addr = simple_strtoul(argv[3], NULL, 16);
+		addr = hextoul(argv[3], NULL);
 		if (!addr)
 			return CMD_RET_FAILURE;
 	}
 	if (argc > 4)
-		size = simple_strtoul(argv[4], NULL, 16);
+		size = hextoul(argv[4], NULL);
 
 	/* check STM32IMAGE presence */
 	if (size == 0) {
diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c
index b33c4b1..b5356ed 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -66,7 +66,7 @@
 		if (!str)
 			goto fail;
 
-		offset = simple_strtoul(str, &end, 16);
+		offset = hextoul(str, &end);
 		if (*end)
 			goto fail;
 	}
diff --git a/arch/arm/mach-zynqmp/mp.c b/arch/arm/mach-zynqmp/mp.c
index 74783ae..704520e 100644
--- a/arch/arm/mach-zynqmp/mp.c
+++ b/arch/arm/mach-zynqmp/mp.c
@@ -252,7 +252,7 @@
 			return 1;
 		}
 
-		u32 boot_addr = simple_strtoul(argv[0], NULL, 16);
+		u32 boot_addr = hextoul(argv[0], NULL);
 		u32 boot_addr_uniq = 0;
 		if (!(boot_addr == ZYNQMP_R5_LOVEC_ADDR ||
 		      boot_addr == ZYNQMP_R5_HIVEC_ADDR)) {
diff --git a/arch/mips/mach-octeon/bootoctlinux.c b/arch/mips/mach-octeon/bootoctlinux.c
index c195dc2..349da08 100644
--- a/arch/mips/mach-octeon/bootoctlinux.c
+++ b/arch/mips/mach-octeon/bootoctlinux.c
@@ -281,8 +281,7 @@
 		} else if (!strncmp(argv[arg], "forceboot", 9)) {
 			boot_args->forceboot = true;
 		} else if (!strncmp(argv[arg], "nodemask=", 9)) {
-			boot_args->node_mask = simple_strtoul(argv[arg] + 9,
-							      NULL, 16);
+			boot_args->node_mask = hextoul(argv[arg] + 9, NULL);
 		} else if (!strncmp(argv[arg], "numcores=", 9)) {
 			memset(node_values, 0, sizeof(node_values));
 			num_values = octeon_parse_nodes(node_values,
@@ -383,7 +382,7 @@
 						   argv[1][1] == 'x' ||
 						   argv[1][1] == 'X' ||
 						   argv[1][1] == '\0'))) {
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		if (!addr)
 			addr = CONFIG_SYS_LOAD_ADDR;
 		arg_start++;
diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c
index b3b8bc2..4cb0f53 100644
--- a/arch/nds32/lib/bootm.c
+++ b/arch/nds32/lib/bootm.c
@@ -64,7 +64,7 @@
 
 	s = env_get("machid");
 	if (s) {
-		machid = simple_strtoul(s, NULL, 16);
+		machid = hextoul(s, NULL);
 		printf("Using machid 0x%x from environment\n", machid);
 	}
 
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index 2c8f973..5037467 100644
--- a/arch/nios2/lib/bootm.c
+++ b/arch/nios2/lib/bootm.c
@@ -27,7 +27,7 @@
 		of_flat_tree = images->ft_addr;
 #endif
 	if (!of_flat_tree && argc > 1)
-		of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16);
+		of_flat_tree = (char *)hextoul(argv[1], NULL);
 	if (of_flat_tree)
 		initrd_end = (ulong)of_flat_tree;
 
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 1343dd3..68a7a78 100644
--- a/arch/powerpc/cpu/mpc83xx/ecc.c
+++ b/arch/powerpc/cpu/mpc83xx/ecc.c
@@ -219,17 +219,17 @@
 			ddr->err_detect = val;
 			return 0;
 		} else if (strcmp(argv[1], "injectdatahi") == 0) {
-			val = simple_strtoul(argv[2], NULL, 16);
+			val = hextoul(argv[2], NULL);
 
 			ddr->data_err_inject_hi = val;
 			return 0;
 		} else if (strcmp(argv[1], "injectdatalo") == 0) {
-			val = simple_strtoul(argv[2], NULL, 16);
+			val = hextoul(argv[2], NULL);
 
 			ddr->data_err_inject_lo = val;
 			return 0;
 		} else if (strcmp(argv[1], "injectecc") == 0) {
-			val = simple_strtoul(argv[2], NULL, 16);
+			val = hextoul(argv[2], NULL);
 			if (val > 0xff) {
 				printf("Incorrect ECC inject mask, "
 				       "should be 0x00..0xff\n");
@@ -269,8 +269,8 @@
 	}
 	if (argc == 4) {
 		if (strcmp(argv[1], "testdw") == 0) {
-			addr = (u64 *) simple_strtoul(argv[2], NULL, 16);
-			count = simple_strtoul(argv[3], NULL, 16);
+			addr = (u64 *)hextoul(argv[2], NULL);
+			count = hextoul(argv[3], NULL);
 
 			if ((u32) addr % 8) {
 				printf("Address not aligned on "
@@ -308,8 +308,8 @@
 			return 0;
 		}
 		if (strcmp(argv[1], "testword") == 0) {
-			addr = (u64 *) simple_strtoul(argv[2], NULL, 16);
-			count = simple_strtoul(argv[3], NULL, 16);
+			addr = (u64 *)hextoul(argv[2], NULL);
+			count = hextoul(argv[3], NULL);
 
 			if ((u32) addr % 8) {
 				printf("Address not aligned on "
diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index 653efe0..b1b002c 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -167,7 +167,7 @@
 	for (i = 1; i < 3; i++) {
 		if (argv[i][0] != '-') {
 			u8 entry = boot_entry_map[i];
-			val = simple_strtoul(argv[i], NULL, 16);
+			val = hextoul(argv[i], NULL);
 			table[entry] = val;
 		}
 	}
diff --git a/arch/sh/lib/zimageboot.c b/arch/sh/lib/zimageboot.c
index c38f093..c2e285f 100644
--- a/arch/sh/lib/zimageboot.c
+++ b/arch/sh/lib/zimageboot.c
@@ -37,11 +37,12 @@
 	}
 
 	if (s0)
-		zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16);
+		zboot_entry = (ulong (*)(int, char * const []))hextoul(s0,
+									NULL);
 
 	/* empty_zero_page */
 	if (s1)
-		param = (unsigned char*)simple_strtoul(s1, NULL, 16);
+		param = (unsigned char *)hextoul(s1, NULL);
 
 	/* Linux kernel command line */
 	cmdline = (char *)param + COMMAND_LINE;
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index cf4210c..9938c80 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -405,17 +405,17 @@
 	}
 
 	if (s)
-		state.bzimage_addr = simple_strtoul(s, NULL, 16);
+		state.bzimage_addr = hextoul(s, NULL);
 
 	if (argc >= 3) {
 		/* argv[2] holds the size of the bzImage */
-		state.bzimage_size = simple_strtoul(argv[2], NULL, 16);
+		state.bzimage_size = hextoul(argv[2], NULL);
 	}
 
 	if (argc >= 4)
-		state.initrd_addr = simple_strtoul(argv[3], NULL, 16);
+		state.initrd_addr = hextoul(argv[3], NULL);
 	if (argc >= 5)
-		state.initrd_size = simple_strtoul(argv[4], NULL, 16);
+		state.initrd_size = hextoul(argv[4], NULL);
 	if (argc >= 6) {
 		/*
 		 * When the base_ptr is passed in, we assume that the image is
@@ -428,7 +428,7 @@
 		 * load address and set bzimage_addr to 0 so we know that it
 		 * cannot be proceesed (or processed again).
 		 */
-		state.base_ptr = (void *)simple_strtoul(argv[5], NULL, 16);
+		state.base_ptr = (void *)hextoul(argv[5], NULL);
 		state.load_address = state.bzimage_addr;
 		state.bzimage_addr = 0;
 	}
@@ -702,7 +702,7 @@
 	struct boot_params *base_ptr = state.base_ptr;
 
 	if (argc > 1)
-		base_ptr = (void *)simple_strtoul(argv[1], NULL, 16);
+		base_ptr = (void *)hextoul(argv[1], NULL);
 	if (!base_ptr) {
 		printf("No zboot setup_base\n");
 		return CMD_RET_FAILURE;
@@ -749,7 +749,7 @@
 	if (argc > 1) {
 		char *endp;
 
-		simple_strtoul(argv[1], &endp, 16);
+		hextoul(argv[1], &endp);
 		/*
 		 * endp pointing to nul means that argv[1] was just a valid
 		 * number, so pass it along to the normal processing
