public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Ubuntu PATCH] Build mmc_block into mmc_core directly
@ 2006-07-03 20:46 Randy Dunlap
  2006-07-03 20:48 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2006-07-03 20:46 UTC (permalink / raw)
  To: rmk+mmc, lkml; +Cc: akpm


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);
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ubuntu PATCH] Build mmc_block into mmc_core directly
  2006-07-03 20:46 [Ubuntu PATCH] Build mmc_block into mmc_core directly Randy Dunlap
@ 2006-07-03 20:48 ` Russell King
  2006-07-04  6:25   ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2006-07-03 20:48 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm

On Mon, Jul 03, 2006 at 01:46:08PM -0700, Randy Dunlap wrote:
> Build mmc_block into mmc_core directly.
> 
> Bug Reference:
> https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335

NAK.  If it's missing the modalias then it needs to be added.  But more
the question is why isn't the driver being automatically loaded.
Probably because hotplug doesn't know enough about the MMC subsystem.
Unfortunately I'm at rather a loss what's required with hotplug because
it isn't something I actually use or come into contact with.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ubuntu PATCH] Build mmc_block into mmc_core directly
  2006-07-03 20:48 ` Russell King
@ 2006-07-04  6:25   ` Marcel Holtmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2006-07-04  6:25 UTC (permalink / raw)
  To: Russell King; +Cc: Randy Dunlap, lkml, akpm

Hi Russell,

> > Build mmc_block into mmc_core directly.
> > 
> > Bug Reference:
> > https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335
> 
> NAK.  If it's missing the modalias then it needs to be added.  But more
> the question is why isn't the driver being automatically loaded.
> Probably because hotplug doesn't know enough about the MMC subsystem.
> Unfortunately I'm at rather a loss what's required with hotplug because
> it isn't something I actually use or come into contact with.

actually Ubuntu can auto load the mmc_block module if needed. I also
have seen a system that looked at the csd.cmdclass value and then
decided to load mmc_block or not. Can't find it on Ubuntu though. Maybe
this was one of my Fedora Core 5 test boxes. Anyway the mmc_block must
stay separate from the mmc_core, because otherwise we will have trouble
to cleanly support SDIO cards in the future.

Regards

Marcel



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-04  6:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-03 20:46 [Ubuntu PATCH] Build mmc_block into mmc_core directly Randy Dunlap
2006-07-03 20:48 ` Russell King
2006-07-04  6:25   ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox