how to get mtd_info in kernel space?
Hi,
get_mtd_device() is used to get an MTD device with a specific minor number. I have several MTD devices enabled and how can I get their minor numbers which can be used to invoke get_mtd_device()? What function call?
Thanks.
- Shawn.
Quoted 4 lines · [email protected] said:
get_mtd_device()is used to get an MTD device with a specific minor
number. I have several MTD devices enabled and how can I get their minor numbers which can be used to invokeget_mtd_device()? What function call?
At the moment you can't. You have to get each one from 0 to MAX_MTD_DEVICES and check whether it's the one you want. We could perhaps implement a get_mtd_device_byname() since JFFS2 wants that too now.
What do you want it for?
--
dwmw2
Er, note also that if you've got a special device which contains only something odd like MAC address for a built-in network card, you don't have to register it with the core MTD code; you can make it available only to your network card driver via some private mechanism if you want.
--
dwmw2
Thanks for the answer. My proposed device will contain basically some configuration data. But they are not as simple as MAC address. The size will grow dynamically.
I want such a flexible function to get minor number because our partitions may be changed later thus those numbers cannot be fixed. Anyway, since now the only way is to use the fix minor number, I'm OK with current mechanism. ;)
- Shawn.