diff options
author | Pierre Ossman <drzeus-list@drzeus.cx> | 2008-03-22 01:54:50 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-23 03:02:20 +0300 |
commit | 51ec92e295d563dd5712d198a7e46c2ae5ccccb2 (patch) | |
tree | fa45408fad483e89b29900b8ca5adf4bb3164467 /drivers/mmc/core/bus.h | |
parent | 03c086a747d0b242878eb881971ec61c1555869d (diff) | |
download | linux-51ec92e295d563dd5712d198a7e46c2ae5ccccb2.tar.xz |
mmc: use sysfs groups to handle conditional attributes
Suppressing uevents turned out to be a bad idea as it screws up the
order of events, making user space very confused. Change the system to
use sysfs groups instead.
This is a regression that, for some odd reason, has gone unnoticed for
some time. It confuses hal so that the block devices (which have the
mmc device as a parent) are not registered. End result being that
desktop magic when cards are inserted won't work.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/core/bus.h')
-rw-r--r-- | drivers/mmc/core/bus.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h index 4f35431116a8..18178766ab46 100644 --- a/drivers/mmc/core/bus.h +++ b/drivers/mmc/core/bus.h @@ -11,7 +11,16 @@ #ifndef _MMC_CORE_BUS_H #define _MMC_CORE_BUS_H -struct mmc_card *mmc_alloc_card(struct mmc_host *host); +#define MMC_DEV_ATTR(name, fmt, args...) \ +static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ +{ \ + struct mmc_card *card = container_of(dev, struct mmc_card, dev); \ + return sprintf(buf, fmt, args); \ +} \ +static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL) + +struct mmc_card *mmc_alloc_card(struct mmc_host *host, + struct device_type *type); int mmc_add_card(struct mmc_card *card); void mmc_remove_card(struct mmc_card *card); |