]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mmc: let host be parent of cards
authorPierre Ossman <drzeus@drzeus.cx>
Sun, 14 Jan 2007 00:41:45 +0000 (01:41 +0100)
committerPierre Ossman <drzeus@drzeus.cx>
Sun, 4 Feb 2007 19:54:06 +0000 (20:54 +0100)
Change the parent of cards to be a specific host (a class
device), not the physical controller. This is particularly
useful when the hardware has multiple slots, meaning
multiple hosts.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/mmc_sysfs.c
include/linux/mmc/host.h

index e334acd045bced56ac88edf5850bde81297d8087..d32698b02d7fe6e2b9f5e1df829caeada5e33170 100644 (file)
@@ -199,7 +199,7 @@ void mmc_init_card(struct mmc_card *card, struct mmc_host *host)
        memset(card, 0, sizeof(struct mmc_card));
        card->host = host;
        device_initialize(&card->dev);
-       card->dev.parent = mmc_dev(host);
+       card->dev.parent = mmc_classdev(host);
        card->dev.bus = &mmc_bus_type;
        card->dev.release = mmc_release_card;
 }
index dc4c6e39519815746e402d95fc7b801bc26c6199..ae98d6766bdd1ca4f309682130dfafd2bf058cbe 100644 (file)
@@ -127,6 +127,7 @@ static inline void *mmc_priv(struct mmc_host *host)
 }
 
 #define mmc_dev(x)     ((x)->parent)
+#define mmc_classdev(x)        (&(x)->class_dev)
 #define mmc_hostname(x)        ((x)->class_dev.bus_id)
 
 extern int mmc_suspend_host(struct mmc_host *, pm_message_t);