[PATCH][MTD] CORE: sysfs support for mtd

Artem Bityutskiy dedekind at infradead.org
Thu Jul 26 02:26:20 EDT 2007


On Wed, 2007-07-25 at 11:08 -0700, sid at ics.uci.edu wrote:
> This patch adds sysfs support for mtd. It exports some of the members of the mtd_info structure
> into the user space via sysfs. The idea is to use sysfs as an alternative to using mtd ioctl(). 
> The following information from mtd_info struct [mtd.h] is exported as files:
> 
> - size              : Partition size
> - erasesize         : Size of erase block
> - writesize         : Page size
> - type              : On of the following -> Absent, RAM, ROM, NOR Flash, NAND Flash, Data flash
> - bbt               : List of bad blocks from device specific block_isbad() function
> - numeraseregions   : Number of erase regions
> 
> The master mtd partition appears as a directory under sysfs as /sys/devices/mtd. For each mtd
> partition (i.e., for each slave mtd found in mtdpart.c), a file under /sys/devices/mtd directory
> by name mtdN (N = partition number) is generated. A struct kobject kobj is added as member of
> struct mtd_info mtd [mtd.h] to enable mtd_info to become part of the kobjects hierarchy. The
> attributes to be exported are added as struct mtd_attr [mtdpart.c]. A soft link from
> /sys/bus/platform/devices/mtd points to /sys/deevices/mtd. Additional attributes can be added by
> adding an entry to the mtd_default_attrs[] structure [mtdpart.c]
> 
> It would be nice if the patch could be tested. I have tested it on a MIPS based board with NAND
> flash. (Please bear with me if the patch does not appear correctly. This is my first patch to the
> list and I have tested by sending the patch to myself as per the FAQs).
> 

Hi, sounds nice although I doubt you'll get much feedback in this list.
I'd suggest you to re-send it with CC to LKML because this is not just
MTD-related. Also, do not forget to add diffstat just before the patch.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list