diff options
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 64 |
1 files changed, 54 insertions, 10 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index e44d92eac8e9..3943a4fde22a 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -357,8 +357,18 @@ ccw_device_remove_disconnected(struct ccw_device *cdev) | |||
357 | cdev->private->dev_id.devno); | 357 | cdev->private->dev_id.devno); |
358 | } | 358 | } |
359 | 359 | ||
360 | int | 360 | /** |
361 | ccw_device_set_offline(struct ccw_device *cdev) | 361 | * ccw_device_set_offline() - disable a ccw device for I/O |
362 | * @cdev: target ccw device | ||
363 | * | ||
364 | * This function calls the driver's set_offline() function for @cdev, if | ||
365 | * given, and then disables @cdev. | ||
366 | * Returns: | ||
367 | * %0 on success and a negative error value on failure. | ||
368 | * Context: | ||
369 | * enabled, ccw device lock not held | ||
370 | */ | ||
371 | int ccw_device_set_offline(struct ccw_device *cdev) | ||
362 | { | 372 | { |
363 | int ret; | 373 | int ret; |
364 | 374 | ||
@@ -396,8 +406,19 @@ ccw_device_set_offline(struct ccw_device *cdev) | |||
396 | return ret; | 406 | return ret; |
397 | } | 407 | } |
398 | 408 | ||
399 | int | 409 | /** |
400 | ccw_device_set_online(struct ccw_device *cdev) | 410 | * ccw_device_set_online() - enable a ccw device for I/O |
411 | * @cdev: target ccw device | ||
412 | * | ||
413 | * This function first enables @cdev and then calls the driver's set_online() | ||
414 | * function for @cdev, if given. If set_online() returns an error, @cdev is | ||
415 | * disabled again. | ||
416 | * Returns: | ||
417 | * %0 on success and a negative error value on failure. | ||
418 | * Context: | ||
419 | * enabled, ccw device lock not held | ||
420 | */ | ||
421 | int ccw_device_set_online(struct ccw_device *cdev) | ||
401 | { | 422 | { |
402 | int ret; | 423 | int ret; |
403 | 424 | ||
@@ -1326,8 +1347,19 @@ __ccwdev_check_busid(struct device *dev, void *id) | |||
1326 | } | 1347 | } |
1327 | 1348 | ||
1328 | 1349 | ||
1329 | struct ccw_device * | 1350 | /** |
1330 | get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id) | 1351 | * get_ccwdev_by_busid() - obtain device from a bus id |
1352 | * @cdrv: driver the device is owned by | ||
1353 | * @bus_id: bus id of the device to be searched | ||
1354 | * | ||
1355 | * This function searches all devices owned by @cdrv for a device with a bus | ||
1356 | * id matching @bus_id. | ||
1357 | * Returns: | ||
1358 | * If a match is found, its reference count of the found device is increased | ||
1359 | * and it is returned; else %NULL is returned. | ||
1360 | */ | ||
1361 | struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv, | ||
1362 | const char *bus_id) | ||
1331 | { | 1363 | { |
1332 | struct device *dev; | 1364 | struct device *dev; |
1333 | struct device_driver *drv; | 1365 | struct device_driver *drv; |
@@ -1409,8 +1441,15 @@ struct bus_type ccw_bus_type = { | |||
1409 | .remove = ccw_device_remove, | 1441 | .remove = ccw_device_remove, |
1410 | }; | 1442 | }; |
1411 | 1443 | ||
1412 | int | 1444 | /** |
1413 | ccw_driver_register (struct ccw_driver *cdriver) | 1445 | * ccw_driver_register() - register a ccw driver |
1446 | * @cdriver: driver to be registered | ||
1447 | * | ||
1448 | * This function is mainly a wrapper around driver_register(). | ||
1449 | * Returns: | ||
1450 | * %0 on success and a negative error value on failure. | ||
1451 | */ | ||
1452 | int ccw_driver_register(struct ccw_driver *cdriver) | ||
1414 | { | 1453 | { |
1415 | struct device_driver *drv = &cdriver->driver; | 1454 | struct device_driver *drv = &cdriver->driver; |
1416 | 1455 | ||
@@ -1420,8 +1459,13 @@ ccw_driver_register (struct ccw_driver *cdriver) | |||
1420 | return driver_register(drv); | 1459 | return driver_register(drv); |
1421 | } | 1460 | } |
1422 | 1461 | ||
1423 | void | 1462 | /** |
1424 | ccw_driver_unregister (struct ccw_driver *cdriver) | 1463 | * ccw_driver_unregister() - deregister a ccw driver |
1464 | * @cdriver: driver to be deregistered | ||
1465 | * | ||
1466 | * This function is mainly a wrapper around driver_unregister(). | ||
1467 | */ | ||
1468 | void ccw_driver_unregister(struct ccw_driver *cdriver) | ||
1425 | { | 1469 | { |
1426 | driver_unregister(&cdriver->driver); | 1470 | driver_unregister(&cdriver->driver); |
1427 | } | 1471 | } |