aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc/host.h
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-09-08 17:46:00 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-09-08 17:46:00 -0400
commit01357dcac62ac028de65a1c315eb75c530c8a5d6 (patch)
tree5310047939d79cf5163047fbe1153ae769104fad /include/linux/mmc/host.h
parent8dc003359cc3996abad9e53a7b2280b272610283 (diff)
[MMC] Ensure correct mmc_priv() behaviour
mmc_priv() has some nasty effects if the wrong pointer type is passed to it. Introduce type checking, which also means we get the right type. Also add an additional member to mmc_host which is used to align host-private data appropriately. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r--include/linux/mmc/host.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index c5d73c0cf6bb..c1f021eddffa 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -109,6 +109,8 @@ struct mmc_host {
109 struct mmc_card *card_selected; /* the selected MMC card */ 109 struct mmc_card *card_selected; /* the selected MMC card */
110 110
111 struct work_struct detect; 111 struct work_struct detect;
112
113 unsigned long private[0] ____cacheline_aligned;
112}; 114};
113 115
114extern struct mmc_host *mmc_alloc_host(int extra, struct device *); 116extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
@@ -116,7 +118,11 @@ extern int mmc_add_host(struct mmc_host *);
116extern void mmc_remove_host(struct mmc_host *); 118extern void mmc_remove_host(struct mmc_host *);
117extern void mmc_free_host(struct mmc_host *); 119extern void mmc_free_host(struct mmc_host *);
118 120
119#define mmc_priv(x) ((void *)((x) + 1)) 121static inline void *mmc_priv(struct mmc_host *host)
122{
123 return (void *)host->private;
124}
125
120#define mmc_dev(x) ((x)->dev) 126#define mmc_dev(x) ((x)->dev)
121#define mmc_hostname(x) ((x)->class_dev.class_id) 127#define mmc_hostname(x) ((x)->class_dev.class_id)
122 128