From: Randy Dunlap <randy.dunlap@oracle.com>
To: rmk+mmc@arm.linux.org.uk, lkml <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@osdl.org>
Subject: [Ubuntu PATCH] Build mmc_block into mmc_core directly
Date: Mon, 03 Jul 2006 13:46:08 -0700 [thread overview]
Message-ID: <44A98210.2060208@oracle.com> (raw)
Build mmc_block into mmc_core directly.
Bug Reference:
https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335
Patch location:
http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=b0bf1e46d11576130fdc68d6ede8a986ce4334a1
---
drivers/mmc/Kconfig | 10 ----------
drivers/mmc/Makefile | 8 +-------
drivers/mmc/mmc_block.c | 10 ++--------
drivers/mmc/mmc_sysfs.c | 26 +++++++++++++++++++++-----
4 files changed, 24 insertions(+), 30 deletions(-)
--- linux-2617-g21.orig/drivers/mmc/Kconfig
+++ linux-2617-g21/drivers/mmc/Kconfig
@@ -19,16 +19,6 @@ config MMC_DEBUG
This is an option for use by developers; most people should
say N here. This enables MMC core and driver debugging.
-config MMC_BLOCK
- tristate "MMC block device driver"
- depends on MMC
- default y
- help
- Say Y here to enable the MMC block device driver support.
- This provides a block device driver, which you can use to
- mount the filesystem. Almost everyone wishing MMC support
- should say Y or M here.
-
config MMC_ARMMMCI
tristate "ARM AMBA Multimedia Card Interface support"
depends on ARM_AMBA && MMC
--- linux-2617-g21.orig/drivers/mmc/Makefile
+++ linux-2617-g21/drivers/mmc/Makefile
@@ -7,12 +7,6 @@
#
obj-$(CONFIG_MMC) += mmc_core.o
-#
-# Media drivers
-#
-obj-$(CONFIG_MMC_BLOCK) += mmc_block.o
-
-#
# Host drivers
#
obj-$(CONFIG_MMC_ARMMMCI) += mmci.o
@@ -24,7 +18,7 @@ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
obj-$(CONFIG_MMC_OMAP) += omap.o
obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o
-mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o
+mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o mmc_block.o
ifeq ($(CONFIG_MMC_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
--- linux-2617-g21.orig/drivers/mmc/mmc_block.c
+++ linux-2617-g21/drivers/mmc/mmc_block.c
@@ -540,7 +540,7 @@ static struct mmc_driver mmc_driver = {
.resume = mmc_blk_resume,
};
-static int __init mmc_blk_init(void)
+int __init mmc_blk_init(void)
{
int res = -ENOMEM;
@@ -559,17 +559,11 @@ static int __init mmc_blk_init(void)
return res;
}
-static void __exit mmc_blk_exit(void)
+void __exit mmc_blk_exit(void)
{
mmc_unregister_driver(&mmc_driver);
unregister_blkdev(major, "mmc");
}
-module_init(mmc_blk_init);
-module_exit(mmc_blk_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver");
-
module_param(major, int, 0444);
MODULE_PARM_DESC(major, "specify the major device number for MMC block driver");
--- linux-2617-g21.orig/drivers/mmc/mmc_sysfs.c
+++ linux-2617-g21/drivers/mmc/mmc_sysfs.c
@@ -317,20 +317,36 @@ void mmc_free_host_sysfs(struct mmc_host
class_device_put(&host->class_dev);
}
+extern int mmc_blk_init(void);
+extern void mmc_blk_exit(void);
static int __init mmc_init(void)
{
int ret = bus_register(&mmc_bus_type);
- if (ret == 0) {
- ret = class_register(&mmc_host_class);
- if (ret)
- bus_unregister(&mmc_bus_type);
- }
+
+ if (ret != 0)
+ return ret;
+
+ ret = class_register(&mmc_host_class);
+ if (ret)
+ goto class_fail;
+
+ ret = mmc_blk_init();
+ if (ret)
+ goto blk_fail;
+
+ return 0;
+
+blk_fail:
+ class_unregister(&mmc_host_class);
+class_fail:
+ bus_unregister(&mmc_bus_type);
return ret;
}
static void __exit mmc_exit(void)
{
+ mmc_blk_exit();
class_unregister(&mmc_host_class);
bus_unregister(&mmc_bus_type);
}
next reply other threads:[~2006-07-03 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-03 20:46 Randy Dunlap [this message]
2006-07-03 20:48 ` [Ubuntu PATCH] Build mmc_block into mmc_core directly Russell King
2006-07-04 6:25 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44A98210.2060208@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+mmc@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox