Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67607
b: refs/heads/master
c: b2ffd8e
h: refs/heads/master
i:
  67605: 9e3508f
  67603: 06f2168
  67599: bb3bbe0
v: v3
  • Loading branch information
Cornelia Huck authored and Martin Schwidefsky committed Oct 12, 2007
1 parent 62c6892 commit 791b7a3
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 193 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c02087162af5d8880ff2d688999d71e1bfa16f2f
refs/heads/master: b2ffd8e9a76ec90bd4a509f3d092e35978c568a3
67 changes: 50 additions & 17 deletions trunk/drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,24 @@ __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)
return 0;
}

/*
* try to add a new ccwgroup device for one driver
* argc and argv[] are a list of bus_id's of devices
* belonging to the driver.
/**
* ccwgroup_create() - create and register a ccw group device
* @root: parent device for the new device
* @creator_id: identifier of creating driver
* @cdrv: ccw driver of slave devices
* @argc: number of slave devices
* @argv: bus ids of slave devices
*
* Create and register a new ccw group device as a child of @root. Slave
* devices are obtained from the list of bus ids given in @argv[] and must all
* belong to @cdrv.
* Returns:
* %0 on success and an error code on failure.
* Context:
* non-atomic
*/
int
ccwgroup_create(struct device *root,
unsigned int creator_id,
struct ccw_driver *cdrv,
int argc, char *argv[])
int ccwgroup_create(struct device *root, unsigned int creator_id,
struct ccw_driver *cdrv, int argc, char *argv[])
{
struct ccwgroup_device *gdev;
int i;
Expand Down Expand Up @@ -390,8 +398,13 @@ static struct bus_type ccwgroup_bus_type = {
.remove = ccwgroup_remove,
};

int
ccwgroup_driver_register (struct ccwgroup_driver *cdriver)
/**
* ccwgroup_driver_register() - register a ccw group driver
* @cdriver: driver to be registered
*
* This function is mainly a wrapper around driver_register().
*/
int ccwgroup_driver_register(struct ccwgroup_driver *cdriver)
{
/* register our new driver with the core */
cdriver->driver.bus = &ccwgroup_bus_type;
Expand All @@ -406,8 +419,13 @@ __ccwgroup_match_all(struct device *dev, void *data)
return 1;
}

void
ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver)
/**
* ccwgroup_driver_unregister() - deregister a ccw group driver
* @cdriver: driver to be deregistered
*
* This function is mainly a wrapper around driver_unregister().
*/
void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
{
struct device *dev;

Expand All @@ -427,8 +445,16 @@ ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver)
driver_unregister(&cdriver->driver);
}

int
ccwgroup_probe_ccwdev(struct ccw_device *cdev)
/**
* ccwgroup_probe_ccwdev() - probe function for slave devices
* @cdev: ccw device to be probed
*
* This is a dummy probe function for ccw devices that are slave devices in
* a ccw group device.
* Returns:
* always %0
*/
int ccwgroup_probe_ccwdev(struct ccw_device *cdev)
{
return 0;
}
Expand All @@ -452,8 +478,15 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
return NULL;
}

void
ccwgroup_remove_ccwdev(struct ccw_device *cdev)
/**
* ccwgroup_remove_ccwdev() - remove function for slave devices
* @cdev: ccw device to be removed
*
* This is a remove function for ccw devices that are slave devices in a ccw
* group device. It sets the ccw device offline and also deregisters the
* embedding ccw group device.
*/
void ccwgroup_remove_ccwdev(struct ccw_device *cdev)
{
struct ccwgroup_device *gdev;

Expand Down
64 changes: 54 additions & 10 deletions trunk/drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,18 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
cdev->private->dev_id.devno);
}

int
ccw_device_set_offline(struct ccw_device *cdev)
/**
* ccw_device_set_offline() - disable a ccw device for I/O
* @cdev: target ccw device
*
* This function calls the driver's set_offline() function for @cdev, if
* given, and then disables @cdev.
* Returns:
* %0 on success and a negative error value on failure.
* Context:
* enabled, ccw device lock not held
*/
int ccw_device_set_offline(struct ccw_device *cdev)
{
int ret;

Expand Down Expand Up @@ -396,8 +406,19 @@ ccw_device_set_offline(struct ccw_device *cdev)
return ret;
}

int
ccw_device_set_online(struct ccw_device *cdev)
/**
* ccw_device_set_online() - enable a ccw device for I/O
* @cdev: target ccw device
*
* This function first enables @cdev and then calls the driver's set_online()
* function for @cdev, if given. If set_online() returns an error, @cdev is
* disabled again.
* Returns:
* %0 on success and a negative error value on failure.
* Context:
* enabled, ccw device lock not held
*/
int ccw_device_set_online(struct ccw_device *cdev)
{
int ret;

Expand Down Expand Up @@ -1326,8 +1347,19 @@ __ccwdev_check_busid(struct device *dev, void *id)
}


struct ccw_device *
get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
/**
* get_ccwdev_by_busid() - obtain device from a bus id
* @cdrv: driver the device is owned by
* @bus_id: bus id of the device to be searched
*
* This function searches all devices owned by @cdrv for a device with a bus
* id matching @bus_id.
* Returns:
* If a match is found, its reference count of the found device is increased
* and it is returned; else %NULL is returned.
*/
struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
const char *bus_id)
{
struct device *dev;
struct device_driver *drv;
Expand Down Expand Up @@ -1409,8 +1441,15 @@ struct bus_type ccw_bus_type = {
.remove = ccw_device_remove,
};

int
ccw_driver_register (struct ccw_driver *cdriver)
/**
* ccw_driver_register() - register a ccw driver
* @cdriver: driver to be registered
*
* This function is mainly a wrapper around driver_register().
* Returns:
* %0 on success and a negative error value on failure.
*/
int ccw_driver_register(struct ccw_driver *cdriver)
{
struct device_driver *drv = &cdriver->driver;

Expand All @@ -1420,8 +1459,13 @@ ccw_driver_register (struct ccw_driver *cdriver)
return driver_register(drv);
}

void
ccw_driver_unregister (struct ccw_driver *cdriver)
/**
* ccw_driver_unregister() - deregister a ccw driver
* @cdriver: driver to be deregistered
*
* This function is mainly a wrapper around driver_unregister().
*/
void ccw_driver_unregister(struct ccw_driver *cdriver)
{
driver_unregister(&cdriver->driver);
}
Expand Down
Loading

0 comments on commit 791b7a3

Please sign in to comment.