diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-13 14:32:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 12:01:16 -0400 |
commit | 647fa371c404606f82fb1c043c87807b5df48f2c (patch) | |
tree | f54876c57fb0f0414078cf61506e43eb7b809de2 /drivers/hv | |
parent | 5ffd00e241ea30fdd907d56419170a1e1338664c (diff) |
hv: move "modalias" bus attribute to dev_groups
This moves the "state" bus attribute to the dev_groups structure.
Tested-by: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/vmbus_drv.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 2114ecb83c93..e3f4370036ab 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c | |||
@@ -131,7 +131,6 @@ static ssize_t vmbus_show_device_attr(struct device *dev, | |||
131 | { | 131 | { |
132 | struct hv_device *hv_dev = device_to_hv_device(dev); | 132 | struct hv_device *hv_dev = device_to_hv_device(dev); |
133 | struct hv_device_info *device_info; | 133 | struct hv_device_info *device_info; |
134 | char alias_name[VMBUS_ALIAS_LEN + 1]; | ||
135 | int ret = 0; | 134 | int ret = 0; |
136 | 135 | ||
137 | device_info = kzalloc(sizeof(struct hv_device_info), GFP_KERNEL); | 136 | device_info = kzalloc(sizeof(struct hv_device_info), GFP_KERNEL); |
@@ -144,9 +143,6 @@ static ssize_t vmbus_show_device_attr(struct device *dev, | |||
144 | ret = sprintf(buf, "{%pUl}\n", device_info->chn_type.b); | 143 | ret = sprintf(buf, "{%pUl}\n", device_info->chn_type.b); |
145 | } else if (!strcmp(dev_attr->attr.name, "device_id")) { | 144 | } else if (!strcmp(dev_attr->attr.name, "device_id")) { |
146 | ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b); | 145 | ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b); |
147 | } else if (!strcmp(dev_attr->attr.name, "modalias")) { | ||
148 | print_alias_name(hv_dev, alias_name); | ||
149 | ret = sprintf(buf, "vmbus:%s\n", alias_name); | ||
150 | } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { | 146 | } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { |
151 | ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); | 147 | ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); |
152 | } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { | 148 | } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { |
@@ -224,10 +220,22 @@ static ssize_t monitor_id_show(struct device *dev, | |||
224 | } | 220 | } |
225 | static DEVICE_ATTR_RO(monitor_id); | 221 | static DEVICE_ATTR_RO(monitor_id); |
226 | 222 | ||
223 | static ssize_t modalias_show(struct device *dev, | ||
224 | struct device_attribute *dev_attr, char *buf) | ||
225 | { | ||
226 | struct hv_device *hv_dev = device_to_hv_device(dev); | ||
227 | char alias_name[VMBUS_ALIAS_LEN + 1]; | ||
228 | |||
229 | print_alias_name(hv_dev, alias_name); | ||
230 | return sprintf(buf, "vmbus:%s\n", alias_name); | ||
231 | } | ||
232 | static DEVICE_ATTR_RO(modalias); | ||
233 | |||
227 | static struct attribute *vmbus_attrs[] = { | 234 | static struct attribute *vmbus_attrs[] = { |
228 | &dev_attr_id.attr, | 235 | &dev_attr_id.attr, |
229 | &dev_attr_state.attr, | 236 | &dev_attr_state.attr, |
230 | &dev_attr_monitor_id.attr, | 237 | &dev_attr_monitor_id.attr, |
238 | &dev_attr_modalias.attr, | ||
231 | NULL, | 239 | NULL, |
232 | }; | 240 | }; |
233 | ATTRIBUTE_GROUPS(vmbus); | 241 | ATTRIBUTE_GROUPS(vmbus); |
@@ -236,7 +244,6 @@ ATTRIBUTE_GROUPS(vmbus); | |||
236 | static struct device_attribute vmbus_device_attrs[] = { | 244 | static struct device_attribute vmbus_device_attrs[] = { |
237 | __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), | 245 | __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), |
238 | __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), | 246 | __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), |
239 | __ATTR(modalias, S_IRUGO, vmbus_show_device_attr, NULL), | ||
240 | 247 | ||
241 | __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), | 248 | __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), |
242 | __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), | 249 | __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), |