X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmmc%2Fcore%2Fbus.h;h=18178766ab461122797734a805041e028a4041cf;hb=837b41b5de356aa67abb2cadb5eef3efc7776f91;hp=4f35431116a86a03dfb97fbb8ca73a3babee726d;hpb=db1b39d8b860e3716620c225bc86e0ec41764e34;p=linux-2.6 diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h index 4f35431116..18178766ab 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);