aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2012-05-15 12:03:46 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-05-16 08:42:49 -0400
commit9814fdfbecbb030454c46ebab88f8ea9819bc143 (patch)
tree9955c8f76caffaa5298239c42a003ac564b10224 /drivers/s390
parentc041f2d487654eb2f981f517b216cf1efdf3cdf2 (diff)
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>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/ccwgroup.c57
-rw-r--r--drivers/s390/net/claw.c11
-rw-r--r--drivers/s390/net/ctcm_main.c5
-rw-r--r--drivers/s390/net/lcs.c5
-rw-r--r--drivers/s390/net/qeth_core_main.c2
5 files changed, 8 insertions, 72 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index c69cee607aed..731470e68493 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -30,19 +30,6 @@
30 * to devices that use multiple subchannels. 30 * to devices that use multiple subchannels.
31 */ 31 */
32 32
33/* a device matches a driver if all its slave devices match the same
34 * entry of the driver */
35static int ccwgroup_bus_match(struct device *dev, struct device_driver * drv)
36{
37 struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
38 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(drv);
39
40 if (gdev->creator_id == gdrv->driver_id)
41 return 1;
42
43 return 0;
44}
45
46static struct bus_type ccwgroup_bus_type; 33static struct bus_type ccwgroup_bus_type;
47 34
48static void __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) 35static 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)
292/** 279/**
293 * ccwgroup_create_dev() - create and register a ccw group device 280 * ccwgroup_create_dev() - create and register a ccw group device
294 * @parent: parent device for the new device 281 * @parent: parent device for the new device
295 * @creator_id: identifier of creating driver
296 * @gdrv: driver for the new group device 282 * @gdrv: driver for the new group device
297 * @num_devices: number of slave devices 283 * @num_devices: number of slave devices
298 * @buf: buffer containing comma separated bus ids of slave devices 284 * @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)
304 * Context: 290 * Context:
305 * non-atomic 291 * non-atomic
306 */ 292 */
307int ccwgroup_create_dev(struct device *parent, unsigned int creator_id, 293int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv,
308 struct ccwgroup_driver *gdrv, int num_devices, 294 int num_devices, const char *buf)
309 const char *buf)
310{ 295{
311 struct ccwgroup_device *gdev; 296 struct ccwgroup_device *gdev;
312 struct ccw_dev_id dev_id; 297 struct ccw_dev_id dev_id;
@@ -320,10 +305,6 @@ int ccwgroup_create_dev(struct device *parent, unsigned int creator_id,
320 atomic_set(&gdev->onoff, 0); 305 atomic_set(&gdev->onoff, 0);
321 mutex_init(&gdev->reg_mutex); 306 mutex_init(&gdev->reg_mutex);
322 mutex_lock(&gdev->reg_mutex); 307 mutex_lock(&gdev->reg_mutex);
323 if (gdrv)
324 gdev->creator_id = gdrv->driver_id;
325 else
326 gdev->creator_id = creator_id;
327 gdev->count = num_devices; 308 gdev->count = num_devices;
328 gdev->dev.bus = &ccwgroup_bus_type; 309 gdev->dev.bus = &ccwgroup_bus_type;
329 gdev->dev.parent = parent; 310 gdev->dev.parent = parent;
@@ -402,30 +383,6 @@ error:
402} 383}
403EXPORT_SYMBOL(ccwgroup_create_dev); 384EXPORT_SYMBOL(ccwgroup_create_dev);
404 385
405/**
406 * ccwgroup_create_from_string() - create and register a ccw group device
407 * @root: parent device for the new device
408 * @creator_id: identifier of creating driver
409 * @cdrv: ccw driver of slave devices
410 * @num_devices: number of slave devices
411 * @buf: buffer containing comma separated bus ids of slave devices
412 *
413 * Create and register a new ccw group device as a child of @root. Slave
414 * devices are obtained from the list of bus ids given in @buf and must all
415 * belong to @cdrv.
416 * Returns:
417 * %0 on success and an error code on failure.
418 * Context:
419 * non-atomic
420 */
421int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
422 struct ccw_driver *cdrv, int num_devices,
423 const char *buf)
424{
425 return ccwgroup_create_dev(root, creator_id, NULL, num_devices, buf);
426}
427EXPORT_SYMBOL(ccwgroup_create_from_string);
428
429static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action, 386static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
430 void *data) 387 void *data)
431{ 388{
@@ -467,14 +424,6 @@ module_exit(cleanup_ccwgroup);
467 424
468/************************** driver stuff ******************************/ 425/************************** driver stuff ******************************/
469 426
470static int ccwgroup_probe(struct device *dev)
471{
472 struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
473 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(dev->driver);
474
475 return gdrv->probe ? gdrv->probe(gdev) : -ENODEV;
476}
477
478static int ccwgroup_remove(struct device *dev) 427static int ccwgroup_remove(struct device *dev)
479{ 428{
480 struct ccwgroup_device *gdev = to_ccwgroupdev(dev); 429 struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
@@ -569,8 +518,6 @@ static const struct dev_pm_ops ccwgroup_pm_ops = {
569 518
570static struct bus_type ccwgroup_bus_type = { 519static struct bus_type ccwgroup_bus_type = {
571 .name = "ccwgroup", 520 .name = "ccwgroup",
572 .match = ccwgroup_bus_match,
573 .probe = ccwgroup_probe,
574 .remove = ccwgroup_remove, 521 .remove = ccwgroup_remove,
575 .shutdown = ccwgroup_shutdown, 522 .shutdown = ccwgroup_shutdown,
576 .pm = &ccwgroup_pm_ops, 523 .pm = &ccwgroup_pm_ops,
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index f7e7dcd74817..634c7e8e631d 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -262,12 +262,10 @@ static struct ccwgroup_driver claw_group_driver = {
262 .owner = THIS_MODULE, 262 .owner = THIS_MODULE,
263 .name = "claw", 263 .name = "claw",
264 }, 264 },
265 .max_slaves = 2,
266 .driver_id = 0xC3D3C1E6,
267 .setup = claw_probe, 265 .setup = claw_probe,
268 .remove = claw_remove_device, 266 .remove = claw_remove_device,
269 .set_online = claw_new_device, 267 .set_online = claw_new_device,
270 .set_offline = claw_shutdown_device, 268 .set_offline = claw_shutdown_device,
271 .prepare = claw_pm_prepare, 269 .prepare = claw_pm_prepare,
272}; 270};
273 271
@@ -292,8 +290,7 @@ static ssize_t claw_driver_group_store(struct device_driver *ddrv,
292 const char *buf, size_t count) 290 const char *buf, size_t count)
293{ 291{
294 int err; 292 int err;
295 err = ccwgroup_create_dev(claw_root_dev, claw_group_driver.driver_id, 293 err = ccwgroup_create_dev(claw_root_dev, &claw_group_driver, 2, buf);
296 &claw_group_driver, 2, buf);
297 return err ? err : count; 294 return err ? err : count;
298} 295}
299static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store); 296static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store);
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index abb84c3849e0..84777e369a29 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1767,8 +1767,6 @@ static struct ccwgroup_driver ctcm_group_driver = {
1767 .owner = THIS_MODULE, 1767 .owner = THIS_MODULE,
1768 .name = CTC_DRIVER_NAME, 1768 .name = CTC_DRIVER_NAME,
1769 }, 1769 },
1770 .max_slaves = 2,
1771 .driver_id = 0xC3E3C3D4, /* CTCM */
1772 .setup = ctcm_probe_device, 1770 .setup = ctcm_probe_device,
1773 .remove = ctcm_remove_device, 1771 .remove = ctcm_remove_device,
1774 .set_online = ctcm_new_device, 1772 .set_online = ctcm_new_device,
@@ -1783,8 +1781,7 @@ static ssize_t ctcm_driver_group_store(struct device_driver *ddrv,
1783{ 1781{
1784 int err; 1782 int err;
1785 1783
1786 err = ccwgroup_create_dev(ctcm_root_dev, ctcm_group_driver.driver_id, 1784 err = ccwgroup_create_dev(ctcm_root_dev, &ctcm_group_driver, 2, buf);
1787 &ctcm_group_driver, 2, buf);
1788 return err ? err : count; 1785 return err ? err : count;
1789} 1786}
1790static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store); 1787static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store);
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0abba9364214..f1dfc8d72d7a 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -2412,8 +2412,6 @@ static struct ccwgroup_driver lcs_group_driver = {
2412 .owner = THIS_MODULE, 2412 .owner = THIS_MODULE,
2413 .name = "lcs", 2413 .name = "lcs",
2414 }, 2414 },
2415 .max_slaves = 2,
2416 .driver_id = 0xD3C3E2,
2417 .setup = lcs_probe_device, 2415 .setup = lcs_probe_device,
2418 .remove = lcs_remove_device, 2416 .remove = lcs_remove_device,
2419 .set_online = lcs_new_device, 2417 .set_online = lcs_new_device,
@@ -2429,8 +2427,7 @@ static ssize_t lcs_driver_group_store(struct device_driver *ddrv,
2429 const char *buf, size_t count) 2427 const char *buf, size_t count)
2430{ 2428{
2431 int err; 2429 int err;
2432 err = ccwgroup_create_dev(lcs_root_dev, lcs_group_driver.driver_id, 2430 err = ccwgroup_create_dev(lcs_root_dev, &lcs_group_driver, 2, buf);
2433 &lcs_group_driver, 2, buf);
2434 return err ? err : count; 2431 return err ? err : count;
2435} 2432}
2436static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store); 2433static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 9423f3d7e20f..d1c87420edf3 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5267,7 +5267,6 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
5267 .owner = THIS_MODULE, 5267 .owner = THIS_MODULE,
5268 .name = "qeth", 5268 .name = "qeth",
5269 }, 5269 },
5270 .driver_id = 0xD8C5E3C8,
5271 .setup = qeth_core_probe_device, 5270 .setup = qeth_core_probe_device,
5272 .remove = qeth_core_remove_device, 5271 .remove = qeth_core_remove_device,
5273 .set_online = qeth_core_set_online, 5272 .set_online = qeth_core_set_online,
@@ -5286,7 +5285,6 @@ static ssize_t qeth_core_driver_group_store(struct device_driver *ddrv,
5286 int err; 5285 int err;
5287 5286
5288 err = ccwgroup_create_dev(qeth_core_root_dev, 5287 err = ccwgroup_create_dev(qeth_core_root_dev,
5289 qeth_core_ccwgroup_driver.driver_id,
5290 &qeth_core_ccwgroup_driver, 3, buf); 5288 &qeth_core_ccwgroup_driver, 3, buf);
5291 5289
5292 return err ? err : count; 5290 return err ? err : count;