diff options
author | Bastian Blank <bastian@waldi.eu.org> | 2005-10-30 18:00:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:16 -0500 |
commit | f1fc78a8c7f3a784b9fd1e07cc1438a0ea569555 (patch) | |
tree | 316c05b4531b8961c59338088642b02e3cccfbd7 /drivers/s390/cio | |
parent | 1e8e338325fa0f2bd5c1c800086e900cf188d2cd (diff) |
[PATCH] s390, ccw - export modalias
This patch exports modalias for ccw devices.
So you can do:
modprobe `echo /sys/device/path_to_device/modalias`
and the proper driver will automatically be loaded by userspace.
Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/device.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 9adc11e8b8bc..1c2659766c09 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -252,6 +252,23 @@ cutype_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | static ssize_t | 254 | static ssize_t |
255 | modalias_show (struct device *dev, struct device_attribute *attr, char *buf) | ||
256 | { | ||
257 | struct ccw_device *cdev = to_ccwdev(dev); | ||
258 | struct ccw_device_id *id = &(cdev->id); | ||
259 | int ret; | ||
260 | |||
261 | ret = sprintf(buf, "ccw:t%04Xm%02x", | ||
262 | id->cu_type, id->cu_model); | ||
263 | if (id->dev_type != 0) | ||
264 | ret += sprintf(buf + ret, "dt%04Xdm%02X\n", | ||
265 | id->dev_type, id->dev_model); | ||
266 | else | ||
267 | ret += sprintf(buf + ret, "dtdm\n"); | ||
268 | return ret; | ||
269 | } | ||
270 | |||
271 | static ssize_t | ||
255 | online_show (struct device *dev, struct device_attribute *attr, char *buf) | 272 | online_show (struct device *dev, struct device_attribute *attr, char *buf) |
256 | { | 273 | { |
257 | struct ccw_device *cdev = to_ccwdev(dev); | 274 | struct ccw_device *cdev = to_ccwdev(dev); |
@@ -448,6 +465,7 @@ static DEVICE_ATTR(chpids, 0444, chpids_show, NULL); | |||
448 | static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); | 465 | static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); |
449 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); | 466 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); |
450 | static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); | 467 | static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); |
468 | static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); | ||
451 | static DEVICE_ATTR(online, 0644, online_show, online_store); | 469 | static DEVICE_ATTR(online, 0644, online_show, online_store); |
452 | extern struct device_attribute dev_attr_cmb_enable; | 470 | extern struct device_attribute dev_attr_cmb_enable; |
453 | static DEVICE_ATTR(availability, 0444, available_show, NULL); | 471 | static DEVICE_ATTR(availability, 0444, available_show, NULL); |
@@ -471,6 +489,7 @@ subchannel_add_files (struct device *dev) | |||
471 | static struct attribute * ccwdev_attrs[] = { | 489 | static struct attribute * ccwdev_attrs[] = { |
472 | &dev_attr_devtype.attr, | 490 | &dev_attr_devtype.attr, |
473 | &dev_attr_cutype.attr, | 491 | &dev_attr_cutype.attr, |
492 | &dev_attr_modalias.attr, | ||
474 | &dev_attr_online.attr, | 493 | &dev_attr_online.attr, |
475 | &dev_attr_cmb_enable.attr, | 494 | &dev_attr_cmb_enable.attr, |
476 | &dev_attr_availability.attr, | 495 | &dev_attr_availability.attr, |