From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: [PATCH 3/3] MTD: remove the 'flags' sysfs file From: Artem Bityutskiy To: David Woodhouse In-Reply-To: <1240306101.19218.2.camel@localhost.localdomain> References: <1240306101.19218.2.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Tue, 21 Apr 2009 12:32:35 +0300 Message-Id: <1240306355.19218.5.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: David Brownell , linux-mtd Reply-To: dedekind@infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , It is bad idea to export the MTD flags via sysfs. It is much cleaner to create a per-flag sysfs file which contains 0 or 1. It is difficult for users to parse '0x400'. We have ioctls which return the flags, no need to add this to sysfs. Cc: David Brownell Signed-off-by: Artem Bityutskiy --- drivers/mtd/mtdcore.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 07105a8..8067d0c 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -91,16 +91,6 @@ static ssize_t mtd_type_show(struct device *dev, } static DEVICE_ATTR(type, S_IRUGO, mtd_type_show, NULL); -static ssize_t mtd_flags_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct mtd_info *mtd = dev_to_mtd(dev); - - return snprintf(buf, PAGE_SIZE, "0x%lx\n", (unsigned long)mtd->flags); - -} -static DEVICE_ATTR(flags, S_IRUGO, mtd_flags_show, NULL); - static ssize_t mtd_size_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -196,7 +186,6 @@ static DEVICE_ATTR(writable, S_IRUGO, mtd_writable_show, NULL); static struct attribute *mtd_attrs[] = { &dev_attr_type.attr, - &dev_attr_flags.attr, &dev_attr_size.attr, &dev_attr_erasesize.attr, &dev_attr_writesize.attr, -- 1.6.0.6 -- Best regards, Artem Bityutskiy (Битюцкий Артём)