linux_5.10: weekly rls 2024.05.22

- d3800a, [feat](mtd):support to get size of nand/nor.

Change-Id: Ie5ced782898cd3623aa3f75c12a4ab62163dc5c1
This commit is contained in:
sophgo-forum-service
2024-05-27 17:18:20 +08:00
committed by carbon
parent e94fea1ceb
commit 215b6707eb
2 changed files with 11 additions and 2 deletions

View File

@ -668,6 +668,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
case BLKRRPART:
case OTPREAD:
case OTPINFO:
case GET_ALL_SIZE:
break;
/* "dangerous" commands */
@ -728,6 +729,14 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
return -EFAULT;
break;
case GET_ALL_SIZE:
{
u64 size = mtd_get_device_size(mtd);
if (copy_to_user(argp, &size, sizeof(u64)))
return -EFAULT;
break;
}
case MEMERASE:
case MEMERASE64:
{

View File

@ -220,8 +220,8 @@ struct otp_message {
#define OTPWRITE _IOW('M', 25, struct mtd_otp_buf)
#define OTPREAD _IOR('M', 26, struct mtd_otp_buf)
#define OTPERASE _IOWR('M', 27, struct erase_info_user)
#define OTPINFO _IOWR('M', 28, struct otp_message)
#define OTPINFO _IOWR('M', 28, struct otp_message)
#define GET_ALL_SIZE _IOR('M', 29, unsigned long long)
/*
* Obsolete legacy interface. Keep it in order not to break userspace
* interfaces