Jörn Engel <[email protected]> writes:
> mtdchar.c is one of the worst drivers inside the kernel. The concept
> of having a simple char device driver for flash may have its charm,
> but the actual implementation is horrible. And things like the
> read-only devices are even unfixable.
This is a confusing statement, you complain that the implementation is horrible
and then go on to complain about the interface to the character device.
The implementation appears small and concise. There are a couple of
FIXMEs but they are all about wishing the interface to the flash chips
mapped better to a user space interface. I routinely fix things in
the kernel whose implementations are much worse than mtdchar.
> Can you name a few examples, where mtdchar.c makes sense? I've found
> it to be quite useless.
I have found just the opposite. It happens to be the only interface
to mtd devices I use. In general when you have flash devices small
enough that you can't use a filesystem without waisting a lot of space
(keeping 1 free erase block out of 4 or 8 is a problem). Or when you are
doing low-level mucking mtdchar is invaluable.
As for the interface to mtdchar. I agree that the readonly character
device is silly, and does weird things to the mtd device minor numbers.
I agree that ioctls are not the prettiest interface around, however
the raw functionality the ioctls export is needed, and interesting. Some
of the functionality would be hard to export even in sysfs the cool ascii
replacement for ioctl.
Long term it does look like a sysfs interface to the mtd functionality
could suffice.
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]