diff mbox series

[LIBUBOOTENV,3/4] uboot_env: don't accept MTD_DATAFLASH and MTD_UBI_VOLUME

Message ID 1561730838-5475-4-git-send-email-philippe.reynes@softathome.com
State Accepted
Headers show
Series None | expand

Commit Message

Philippe REYNES June 28, 2019, 2:07 p.m. UTC
The flash type MTD_DATAFLASH and MTD_UBI_VOLUME aren't
supported by function devread and devwrite. So it's not
usefull to accept them when checking the device type.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
---
 src/uboot_env.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Stefano Babic July 2, 2019, 11:50 a.m. UTC | #1
On 28/06/19 16:07, Philippe Reynes wrote:
> The flash type MTD_DATAFLASH and MTD_UBI_VOLUME aren't
> supported by function devread and devwrite. So it's not
> usefull to accept them when checking the device type.
> 
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> ---
>  src/uboot_env.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/uboot_env.c b/src/uboot_env.c
> index 9f86821..749cf4c 100644
> --- a/src/uboot_env.c
> +++ b/src/uboot_env.c
> @@ -154,9 +154,7 @@ static int check_env_device(struct uboot_ctx *ctx, struct uboot_flash_env *dev)
>  	if (S_ISCHR(st.st_mode)) {
>  		ret = ioctl(fd, MEMGETINFO, &dev->mtdinfo);
>  		if (ret < 0 || (dev->mtdinfo.type != MTD_NORFLASH &&
> -		    dev->mtdinfo.type != MTD_NANDFLASH &&
> -		    dev->mtdinfo.type != MTD_DATAFLASH &&
> -		    dev->mtdinfo.type != MTD_UBIVOLUME)) {
> +		    dev->mtdinfo.type != MTD_NANDFLASH)) {
>  			close(fd);
>  			return -EBADF;
>  		}
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/src/uboot_env.c b/src/uboot_env.c
index 9f86821..749cf4c 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -154,9 +154,7 @@  static int check_env_device(struct uboot_ctx *ctx, struct uboot_flash_env *dev)
 	if (S_ISCHR(st.st_mode)) {
 		ret = ioctl(fd, MEMGETINFO, &dev->mtdinfo);
 		if (ret < 0 || (dev->mtdinfo.type != MTD_NORFLASH &&
-		    dev->mtdinfo.type != MTD_NANDFLASH &&
-		    dev->mtdinfo.type != MTD_DATAFLASH &&
-		    dev->mtdinfo.type != MTD_UBIVOLUME)) {
+		    dev->mtdinfo.type != MTD_NANDFLASH)) {
 			close(fd);
 			return -EBADF;
 		}