mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
mtd, nand: Move common functions from cmd_nand.c to common place
Move common functions from cmd_nand.c (for calculating offset and size from cmdline paramter) to common place, so they could used from other commands which use mtd partitions. For onenand the arg_off_size() is left in common/cmd_onenand.c. It should use now the common arg_off() function, but as I could not test onenand I let it there ... Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
This commit is contained in:
committed by
Jagan Teki
parent
9fe6d8716e
commit
09c3280754
@@ -909,3 +909,19 @@ void print_grouped_ull(unsigned long long int_val, int digits)
|
||||
grab = 3;
|
||||
}
|
||||
}
|
||||
|
||||
bool str2off(const char *p, loff_t *num)
|
||||
{
|
||||
char *endptr;
|
||||
|
||||
*num = simple_strtoull(p, &endptr, 16);
|
||||
return *p != '\0' && *endptr == '\0';
|
||||
}
|
||||
|
||||
bool str2long(const char *p, ulong *num)
|
||||
{
|
||||
char *endptr;
|
||||
|
||||
*num = simple_strtoul(p, &endptr, 16);
|
||||
return *p != '\0' && *endptr == '\0';
|
||||
}
|
||||
|
Reference in New Issue
Block a user