diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rapidio/rio-driver.c | 18 | ||||
-rw-r--r-- | drivers/rapidio/rio-sysfs.c | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c index a0c875563d76..3e9b6a78ad18 100644 --- a/drivers/rapidio/rio-driver.c +++ b/drivers/rapidio/rio-driver.c | |||
@@ -199,6 +199,23 @@ static int rio_match_bus(struct device *dev, struct device_driver *drv) | |||
199 | out:return 0; | 199 | out:return 0; |
200 | } | 200 | } |
201 | 201 | ||
202 | static int rio_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
203 | { | ||
204 | struct rio_dev *rdev; | ||
205 | |||
206 | if (!dev) | ||
207 | return -ENODEV; | ||
208 | |||
209 | rdev = to_rio_dev(dev); | ||
210 | if (!rdev) | ||
211 | return -ENODEV; | ||
212 | |||
213 | if (add_uevent_var(env, "MODALIAS=rapidio:v%04Xd%04Xav%04Xad%04X", | ||
214 | rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did)) | ||
215 | return -ENOMEM; | ||
216 | return 0; | ||
217 | } | ||
218 | |||
202 | struct device rio_bus = { | 219 | struct device rio_bus = { |
203 | .init_name = "rapidio", | 220 | .init_name = "rapidio", |
204 | }; | 221 | }; |
@@ -210,6 +227,7 @@ struct bus_type rio_bus_type = { | |||
210 | .bus_attrs = rio_bus_attrs, | 227 | .bus_attrs = rio_bus_attrs, |
211 | .probe = rio_device_probe, | 228 | .probe = rio_device_probe, |
212 | .remove = rio_device_remove, | 229 | .remove = rio_device_remove, |
230 | .uevent = rio_uevent, | ||
213 | }; | 231 | }; |
214 | 232 | ||
215 | /** | 233 | /** |
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c index 0c4473e54f86..9331be646dc3 100644 --- a/drivers/rapidio/rio-sysfs.c +++ b/drivers/rapidio/rio-sysfs.c | |||
@@ -84,6 +84,15 @@ static ssize_t lnext_show(struct device *dev, | |||
84 | return str - buf; | 84 | return str - buf; |
85 | } | 85 | } |
86 | 86 | ||
87 | static ssize_t modalias_show(struct device *dev, | ||
88 | struct device_attribute *attr, char *buf) | ||
89 | { | ||
90 | struct rio_dev *rdev = to_rio_dev(dev); | ||
91 | |||
92 | return sprintf(buf, "rapidio:v%04Xd%04Xav%04Xad%04X\n", | ||
93 | rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did); | ||
94 | } | ||
95 | |||
87 | struct device_attribute rio_dev_attrs[] = { | 96 | struct device_attribute rio_dev_attrs[] = { |
88 | __ATTR_RO(did), | 97 | __ATTR_RO(did), |
89 | __ATTR_RO(vid), | 98 | __ATTR_RO(vid), |
@@ -93,6 +102,7 @@ struct device_attribute rio_dev_attrs[] = { | |||
93 | __ATTR_RO(asm_rev), | 102 | __ATTR_RO(asm_rev), |
94 | __ATTR_RO(lprev), | 103 | __ATTR_RO(lprev), |
95 | __ATTR_RO(destid), | 104 | __ATTR_RO(destid), |
105 | __ATTR_RO(modalias), | ||
96 | __ATTR_NULL, | 106 | __ATTR_NULL, |
97 | }; | 107 | }; |
98 | 108 | ||