diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-07 02:55:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 21:36:02 -0400 |
commit | f24fc57b24444fe31fbddb5716195bb8bbc70b58 (patch) | |
tree | 94f938b3de68ea64280e708349bca81762f58e92 /drivers/mmc/core | |
parent | 2df4390130a85c2dd85ba3eb96f0c25ae7c5bca3 (diff) |
MMC: convert bus code to use dev_groups
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the MMC bus code to use the
correct field.
Cc: Chris Ball <cjb@laptop.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Konstantin Dorfman <kdorfman@codeaurora.org>
Cc: Seungwon Jeon <tgih.jun@samsung.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/bus.c | 12 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_bus.c | 21 |
2 files changed, 19 insertions, 14 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 704bf66f5873..3e227bd91e81 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #define to_mmc_driver(d) container_of(d, struct mmc_driver, drv) | 28 | #define to_mmc_driver(d) container_of(d, struct mmc_driver, drv) |
29 | 29 | ||
30 | static ssize_t mmc_type_show(struct device *dev, | 30 | static ssize_t type_show(struct device *dev, |
31 | struct device_attribute *attr, char *buf) | 31 | struct device_attribute *attr, char *buf) |
32 | { | 32 | { |
33 | struct mmc_card *card = mmc_dev_to_card(dev); | 33 | struct mmc_card *card = mmc_dev_to_card(dev); |
@@ -45,11 +45,13 @@ static ssize_t mmc_type_show(struct device *dev, | |||
45 | return -EFAULT; | 45 | return -EFAULT; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | static DEVICE_ATTR_RO(type); | ||
48 | 49 | ||
49 | static struct device_attribute mmc_dev_attrs[] = { | 50 | static struct attribute *mmc_dev_attrs[] = { |
50 | __ATTR(type, S_IRUGO, mmc_type_show, NULL), | 51 | &dev_attr_type.attr, |
51 | __ATTR_NULL, | 52 | NULL, |
52 | }; | 53 | }; |
54 | ATTRIBUTE_GROUPS(mmc_dev); | ||
53 | 55 | ||
54 | /* | 56 | /* |
55 | * This currently matches any MMC driver to any MMC card - drivers | 57 | * This currently matches any MMC driver to any MMC card - drivers |
@@ -218,7 +220,7 @@ static const struct dev_pm_ops mmc_bus_pm_ops = { | |||
218 | 220 | ||
219 | static struct bus_type mmc_bus_type = { | 221 | static struct bus_type mmc_bus_type = { |
220 | .name = "mmc", | 222 | .name = "mmc", |
221 | .dev_attrs = mmc_dev_attrs, | 223 | .dev_groups = mmc_dev_groups, |
222 | .match = mmc_bus_match, | 224 | .match = mmc_bus_match, |
223 | .uevent = mmc_bus_uevent, | 225 | .uevent = mmc_bus_uevent, |
224 | .probe = mmc_bus_probe, | 226 | .probe = mmc_bus_probe, |
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 6d67492a9247..ef8956568c3a 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c | |||
@@ -34,7 +34,8 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \ | |||
34 | \ | 34 | \ |
35 | func = dev_to_sdio_func (dev); \ | 35 | func = dev_to_sdio_func (dev); \ |
36 | return sprintf (buf, format_string, func->field); \ | 36 | return sprintf (buf, format_string, func->field); \ |
37 | } | 37 | } \ |
38 | static DEVICE_ATTR_RO(field) | ||
38 | 39 | ||
39 | sdio_config_attr(class, "0x%02x\n"); | 40 | sdio_config_attr(class, "0x%02x\n"); |
40 | sdio_config_attr(vendor, "0x%04x\n"); | 41 | sdio_config_attr(vendor, "0x%04x\n"); |
@@ -47,14 +48,16 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
47 | return sprintf(buf, "sdio:c%02Xv%04Xd%04X\n", | 48 | return sprintf(buf, "sdio:c%02Xv%04Xd%04X\n", |
48 | func->class, func->vendor, func->device); | 49 | func->class, func->vendor, func->device); |
49 | } | 50 | } |
50 | 51 | static DEVICE_ATTR_RO(modalias); | |
51 | static struct device_attribute sdio_dev_attrs[] = { | 52 | |
52 | __ATTR_RO(class), | 53 | static struct attribute *sdio_dev_attrs[] = { |
53 | __ATTR_RO(vendor), | 54 | &dev_attr_class.attr, |
54 | __ATTR_RO(device), | 55 | &dev_attr_vendor.attr, |
55 | __ATTR_RO(modalias), | 56 | &dev_attr_device.attr, |
56 | __ATTR_NULL, | 57 | &dev_attr_modalias.attr, |
58 | NULL, | ||
57 | }; | 59 | }; |
60 | ATTRIBUTE_GROUPS(sdio_dev); | ||
58 | 61 | ||
59 | static const struct sdio_device_id *sdio_match_one(struct sdio_func *func, | 62 | static const struct sdio_device_id *sdio_match_one(struct sdio_func *func, |
60 | const struct sdio_device_id *id) | 63 | const struct sdio_device_id *id) |
@@ -225,7 +228,7 @@ static const struct dev_pm_ops sdio_bus_pm_ops = { | |||
225 | 228 | ||
226 | static struct bus_type sdio_bus_type = { | 229 | static struct bus_type sdio_bus_type = { |
227 | .name = "sdio", | 230 | .name = "sdio", |
228 | .dev_attrs = sdio_dev_attrs, | 231 | .dev_groups = sdio_dev_groups, |
229 | .match = sdio_bus_match, | 232 | .match = sdio_bus_match, |
230 | .uevent = sdio_bus_uevent, | 233 | .uevent = sdio_bus_uevent, |
231 | .probe = sdio_bus_probe, | 234 | .probe = sdio_bus_probe, |