From patchwork Sat Apr 4 18:03:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Cernekee X-Patchwork-Id: 25593 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 ozlabs.org (Postfix) with ESMTPS id 8048ADDD1C for ; Sun, 5 Apr 2009 04:08:31 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LqAD9-0008Gf-86; Sat, 04 Apr 2009 18:03:19 +0000 Received: from qw-out-1920.google.com ([74.125.92.149]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LqACw-0008Ek-9a for linux-mtd@lists.infradead.org; Sat, 04 Apr 2009 18:03:14 +0000 Received: by qw-out-1920.google.com with SMTP id 5so1159591qwf.24 for ; Sat, 04 Apr 2009 11:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=BN860QFb0NqGN1m5G91SBv+Sr4mEWivEG6xzBrHczsc=; b=ktXZDQvQl068+ODEO4zhjoSNhN1P9kDbmQmRrAHP4ZSokoiAuuZ7u2NLeLhmpbyijq IyG2nF1RupJrbnap2HvSv4x+3AI0oWco8v8SO7gmmhiD+knbSYeRCbz1uw0QTeK6al1B XihNXU3Mak6PfAT+m83YrJcZ0NU6a6v0nq+XA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=BVo23CX8WToIl0rreunngfPRrjMKVx9V9yj6oz7FTHHFMLWv20EvIaVzB6Z7YqpCkB RN8ay2/u2uyA/shKEitg6k3LFcEwO3QJ3bKAMY1PqCn6/+/c/lOyfxvnI/7GQiDYwR1l 8GCLVhgyIvU2uP1izxZAl8b6wN7twByo35s6c= MIME-Version: 1.0 Received: by 10.229.85.21 with SMTP id m21mr651487qcl.9.1238868184997; Sat, 04 Apr 2009 11:03:04 -0700 (PDT) Date: Sat, 4 Apr 2009 11:03:04 -0700 Message-ID: Subject: [PATCH] [MTD] sysfs support should not depend on CONFIG_PROC_FS From: Kevin Cernekee To: David Woodhouse , David Brownell X-Spam-Score: 0.0 (/) Cc: Linux MTD , "linux-kernel@vger.kernel.org" X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list 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 Move the driver model init code out of the "#ifdef CONFIG_PROC_FS" block. Tested with both values of CONFIG_PROC_FS . Tested with CONFIG_MTD=m . Issue was reported here: http://lkml.org/lkml/2009/4/4/107 Signed-off-by: Kevin Cernekee --- drivers/mtd/mtdcore.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 89c1e5d..fdd6ae8 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -585,6 +585,8 @@ done: return ((count < begin+len-off) ? count : begin+len-off); } +#endif /* CONFIG_PROC_FS */ + /*====================================================================*/ /* Init code */ @@ -596,24 +598,25 @@ static int __init init_mtd(void) pr_err("Error creating mtd class.\n"); return PTR_ERR(mtd_class); } +#ifdef CONFIG_PROC_FS if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) proc_mtd->read_proc = mtd_read_proc; +#endif /* CONFIG_PROC_FS */ return 0; } static void __exit cleanup_mtd(void) { +#ifdef CONFIG_PROC_FS if (proc_mtd) remove_proc_entry( "mtd", NULL); +#endif /* CONFIG_PROC_FS */ class_destroy(mtd_class); } module_init(init_mtd); module_exit(cleanup_mtd); -#endif /* CONFIG_PROC_FS */ - - MODULE_LICENSE("GPL"); MODULE_AUTHOR("David Woodhouse "); MODULE_DESCRIPTION("Core MTD registration and access routines");