diff options
Diffstat (limited to 'drivers/mmc/core/sysfs.h')
-rw-r--r-- | drivers/mmc/core/sysfs.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mmc/core/sysfs.h b/drivers/mmc/core/sysfs.h index 80e29b3582..2a326a5b83 100644 --- a/drivers/mmc/core/sysfs.h +++ b/drivers/mmc/core/sysfs.h | |||
@@ -11,9 +11,17 @@ | |||
11 | #ifndef _MMC_CORE_SYSFS_H | 11 | #ifndef _MMC_CORE_SYSFS_H |
12 | #define _MMC_CORE_SYSFS_H | 12 | #define _MMC_CORE_SYSFS_H |
13 | 13 | ||
14 | void mmc_init_card(struct mmc_card *card, struct mmc_host *host); | 14 | #define MMC_ATTR_FN(name, fmt, args...) \ |
15 | int mmc_register_card(struct mmc_card *card); | 15 | static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ |
16 | void mmc_remove_card(struct mmc_card *card); | 16 | { \ |
17 | struct mmc_card *card = container_of(dev, struct mmc_card, dev);\ | ||
18 | return sprintf(buf, fmt, args); \ | ||
19 | } | ||
20 | |||
21 | #define MMC_ATTR_RO(name) __ATTR(name, S_IRUGO, mmc_##name##_show, NULL) | ||
22 | |||
23 | int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs); | ||
24 | void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs); | ||
17 | 25 | ||
18 | struct mmc_host *mmc_alloc_host_sysfs(int extra, struct device *dev); | 26 | struct mmc_host *mmc_alloc_host_sysfs(int extra, struct device *dev); |
19 | int mmc_add_host_sysfs(struct mmc_host *host); | 27 | int mmc_add_host_sysfs(struct mmc_host *host); |