From patchwork Tue Apr 21 09:32:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 26231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 706FDB6F56 for ; Tue, 21 Apr 2009 19:35:26 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LwCLl-0002F1-SN; Tue, 21 Apr 2009 09:33:09 +0000 Received: from smtp.nokia.com ([192.100.122.233] helo=mgw-mx06.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LwCLQ-0002Cl-HB; Tue, 21 Apr 2009 09:32:55 +0000 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n3L9WZUH003150; Tue, 21 Apr 2009 12:32:42 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Apr 2009 12:32:37 +0300 Received: from mgw-int02.ntc.nokia.com ([172.21.143.97]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Apr 2009 12:32:36 +0300 Received: from [172.21.42.232] (esdhcp042232.research.nokia.com [172.21.42.232]) by mgw-int02.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n3L9WZSi013786; Tue, 21 Apr 2009 12:32:35 +0300 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> Date: Tue, 21 Apr 2009 12:32:35 +0300 Message-Id: <1240306355.19218.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 (2.24.5-1.fc10) X-OriginalArrivalTime: 21 Apr 2009 09:32:37.0043 (UTC) FILETIME=[1B7C7830:01C9C264] X-Nokia-AV: Clean X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Score: -4.0 (----) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-4.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.100.122.233 listed in list.dnswl.org] X-Mailman-Approved-At: Tue, 21 Apr 2009 05:33:07 -0400 Cc: David Brownell , linux-mtd X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: dedekind@infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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,