Skip to contentSkip to conversation

how to get mtd_info in kernel space?

DISCUSSION Xiaogeng (Shawn) Jin 2 participants 4 messages Aug 27, 2002 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
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 invoke get_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

#2 lore raw
In reply to Xiaogeng (Shawn) Jin

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

#3 lore raw

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.