Merge branch 'docs' of git://git.lwn.net/linux-2.6
[pandora-kernel.git] / drivers / mmc / core / bus.c
index b0c22ca..0d9b2d6 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
 
-#include "sysfs.h"
 #include "core.h"
 #include "sdio_cis.h"
 #include "bus.h"
@@ -43,7 +42,7 @@ static ssize_t mmc_type_show(struct device *dev,
 }
 
 static struct device_attribute mmc_dev_attrs[] = {
-       MMC_ATTR_RO(type),
+       __ATTR(type, S_IRUGO, mmc_type_show, NULL),
        __ATTR_NULL,
 };
 
@@ -189,7 +188,7 @@ static void mmc_release_card(struct device *dev)
 /*
  * Allocate and initialise a new MMC card structure.
  */
-struct mmc_card *mmc_alloc_card(struct mmc_host *host)
+struct mmc_card *mmc_alloc_card(struct mmc_host *host, struct device_type *type)
 {
        struct mmc_card *card;
 
@@ -204,6 +203,7 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host)
        card->dev.parent = mmc_classdev(host);
        card->dev.bus = &mmc_bus_type;
        card->dev.release = mmc_release_card;
+       card->dev.type = type;
 
        return card;
 }
@@ -248,23 +248,13 @@ int mmc_add_card(struct mmc_card *card)
                        type, card->rca);
        }
 
-       card->dev.uevent_suppress = 1;
-
        ret = device_add(&card->dev);
        if (ret)
                return ret;
 
-       if (card->host->bus_ops->sysfs_add) {
-               ret = card->host->bus_ops->sysfs_add(card->host, card);
-               if (ret) {
-                       device_del(&card->dev);
-                       return ret;
-                }
-       }
-
-       card->dev.uevent_suppress = 0;
-
-       kobject_uevent(&card->dev.kobj, KOBJ_ADD);
+#ifdef CONFIG_DEBUG_FS
+       mmc_add_card_debugfs(card);
+#endif
 
        mmc_card_set_present(card);
 
@@ -277,6 +267,10 @@ int mmc_add_card(struct mmc_card *card)
  */
 void mmc_remove_card(struct mmc_card *card)
 {
+#ifdef CONFIG_DEBUG_FS
+       mmc_remove_card_debugfs(card);
+#endif
+
        if (mmc_card_present(card)) {
                if (mmc_host_is_spi(card->host)) {
                        printk(KERN_INFO "%s: SPI card removed\n",
@@ -285,9 +279,6 @@ void mmc_remove_card(struct mmc_card *card)
                        printk(KERN_INFO "%s: card %04x removed\n",
                                mmc_hostname(card->host), card->rca);
                }
-
-               if (card->host->bus_ops->sysfs_remove)
-                       card->host->bus_ops->sysfs_remove(card->host, card);
                device_del(&card->dev);
        }