s390/ccwgroup: remove ccwgroup_create_from_string

Remove the old ccwgroup_create_from_string interface since all
drivers have been converted to ccwgroup_create_dev. Also remove
now unused members of ccwgroup_driver.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Sebastian Ott 2012-05-15 18:03:46 +02:00 коммит произвёл Martin Schwidefsky
Родитель c041f2d487
Коммит 9814fdfbec
6 изменённых файлов: 10 добавлений и 85 удалений

Просмотреть файл

@ -29,10 +29,7 @@ struct ccwgroup_device {
/**
* struct ccwgroup_driver - driver for ccw group devices
* @max_slaves: maximum number of slave devices
* @driver_id: unique id
* @setup: function called during device creation to setup the device
* @probe: function called on probe
* @remove: function called on remove
* @set_online: function called when device is set online
* @set_offline: function called when device is set offline
@ -45,11 +42,7 @@ struct ccwgroup_device {
* @driver: embedded driver structure
*/
struct ccwgroup_driver {
int max_slaves;
unsigned long driver_id;
int (*setup) (struct ccwgroup_device *);
int (*probe) (struct ccwgroup_device *);
void (*remove) (struct ccwgroup_device *);
int (*set_online) (struct ccwgroup_device *);
int (*set_offline) (struct ccwgroup_device *);
@ -65,12 +58,8 @@ struct ccwgroup_driver {
extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver);
int ccwgroup_create_dev(struct device *root, unsigned int creator_id,
struct ccwgroup_driver *gdrv, int num_devices,
const char *buf);
int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
struct ccw_driver *cdrv, int num_devices,
const char *buf);
int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv,
int num_devices, const char *buf);
extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);

Просмотреть файл

@ -30,19 +30,6 @@
* to devices that use multiple subchannels.
*/
/* a device matches a driver if all its slave devices match the same
* entry of the driver */
static int ccwgroup_bus_match(struct device *dev, struct device_driver * drv)
{
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
struct ccwgroup_driver *gdrv = to_ccwgroupdrv(drv);
if (gdev->creator_id == gdrv->driver_id)
return 1;
return 0;
}
static struct bus_type ccwgroup_bus_type;
static void __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)
@ -292,7 +279,6 @@ static int __get_next_id(const char **buf, struct ccw_dev_id *id)
/**
* ccwgroup_create_dev() - create and register a ccw group device
* @parent: parent device for the new device
* @creator_id: identifier of creating driver
* @gdrv: driver for the new group device
* @num_devices: number of slave devices
* @buf: buffer containing comma separated bus ids of slave devices
@ -304,9 +290,8 @@ static int __get_next_id(const char **buf, struct ccw_dev_id *id)
* Context:
* non-atomic
*/
int ccwgroup_create_dev(struct device *parent, unsigned int creator_id,
struct ccwgroup_driver *gdrv, int num_devices,
const char *buf)
int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv,
int num_devices, const char *buf)
{
struct ccwgroup_device *gdev;
struct ccw_dev_id dev_id;
@ -320,10 +305,6 @@ int ccwgroup_create_dev(struct device *parent, unsigned int creator_id,
atomic_set(&gdev->onoff, 0);
mutex_init(&gdev->reg_mutex);
mutex_lock(&gdev->reg_mutex);
if (gdrv)
gdev->creator_id = gdrv->driver_id;
else
gdev->creator_id = creator_id;
gdev->count = num_devices;
gdev->dev.bus = &ccwgroup_bus_type;
gdev->dev.parent = parent;
@ -402,30 +383,6 @@ error:
}
EXPORT_SYMBOL(ccwgroup_create_dev);
/**
* ccwgroup_create_from_string() - 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
* @num_devices: number of slave devices
* @buf: buffer containing comma separated 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 @buf and must all
* belong to @cdrv.
* Returns:
* %0 on success and an error code on failure.
* Context:
* non-atomic
*/
int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
struct ccw_driver *cdrv, int num_devices,
const char *buf)
{
return ccwgroup_create_dev(root, creator_id, NULL, num_devices, buf);
}
EXPORT_SYMBOL(ccwgroup_create_from_string);
static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
void *data)
{
@ -467,14 +424,6 @@ module_exit(cleanup_ccwgroup);
/************************** driver stuff ******************************/
static int ccwgroup_probe(struct device *dev)
{
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
struct ccwgroup_driver *gdrv = to_ccwgroupdrv(dev->driver);
return gdrv->probe ? gdrv->probe(gdev) : -ENODEV;
}
static int ccwgroup_remove(struct device *dev)
{
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
@ -569,8 +518,6 @@ static const struct dev_pm_ops ccwgroup_pm_ops = {
static struct bus_type ccwgroup_bus_type = {
.name = "ccwgroup",
.match = ccwgroup_bus_match,
.probe = ccwgroup_probe,
.remove = ccwgroup_remove,
.shutdown = ccwgroup_shutdown,
.pm = &ccwgroup_pm_ops,

Просмотреть файл

@ -262,12 +262,10 @@ static struct ccwgroup_driver claw_group_driver = {
.owner = THIS_MODULE,
.name = "claw",
},
.max_slaves = 2,
.driver_id = 0xC3D3C1E6,
.setup = claw_probe,
.remove = claw_remove_device,
.set_online = claw_new_device,
.set_offline = claw_shutdown_device,
.remove = claw_remove_device,
.set_online = claw_new_device,
.set_offline = claw_shutdown_device,
.prepare = claw_pm_prepare,
};
@ -292,8 +290,7 @@ static ssize_t claw_driver_group_store(struct device_driver *ddrv,
const char *buf, size_t count)
{
int err;
err = ccwgroup_create_dev(claw_root_dev, claw_group_driver.driver_id,
&claw_group_driver, 2, buf);
err = ccwgroup_create_dev(claw_root_dev, &claw_group_driver, 2, buf);
return err ? err : count;
}
static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store);

Просмотреть файл

@ -1767,8 +1767,6 @@ static struct ccwgroup_driver ctcm_group_driver = {
.owner = THIS_MODULE,
.name = CTC_DRIVER_NAME,
},
.max_slaves = 2,
.driver_id = 0xC3E3C3D4, /* CTCM */
.setup = ctcm_probe_device,
.remove = ctcm_remove_device,
.set_online = ctcm_new_device,
@ -1783,8 +1781,7 @@ static ssize_t ctcm_driver_group_store(struct device_driver *ddrv,
{
int err;
err = ccwgroup_create_dev(ctcm_root_dev, ctcm_group_driver.driver_id,
&ctcm_group_driver, 2, buf);
err = ccwgroup_create_dev(ctcm_root_dev, &ctcm_group_driver, 2, buf);
return err ? err : count;
}
static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store);

Просмотреть файл

@ -2412,8 +2412,6 @@ static struct ccwgroup_driver lcs_group_driver = {
.owner = THIS_MODULE,
.name = "lcs",
},
.max_slaves = 2,
.driver_id = 0xD3C3E2,
.setup = lcs_probe_device,
.remove = lcs_remove_device,
.set_online = lcs_new_device,
@ -2429,8 +2427,7 @@ static ssize_t lcs_driver_group_store(struct device_driver *ddrv,
const char *buf, size_t count)
{
int err;
err = ccwgroup_create_dev(lcs_root_dev, lcs_group_driver.driver_id,
&lcs_group_driver, 2, buf);
err = ccwgroup_create_dev(lcs_root_dev, &lcs_group_driver, 2, buf);
return err ? err : count;
}
static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store);

Просмотреть файл

@ -5267,7 +5267,6 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
.owner = THIS_MODULE,
.name = "qeth",
},
.driver_id = 0xD8C5E3C8,
.setup = qeth_core_probe_device,
.remove = qeth_core_remove_device,
.set_online = qeth_core_set_online,
@ -5286,7 +5285,6 @@ static ssize_t qeth_core_driver_group_store(struct device_driver *ddrv,
int err;
err = ccwgroup_create_dev(qeth_core_root_dev,
qeth_core_ccwgroup_driver.driver_id,
&qeth_core_ccwgroup_driver, 3, buf);
return err ? err : count;