diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-11-30 10:19:57 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2021-01-19 12:29:25 +0100 |
commit | 29c53de014430bbf7febb402afd3f8149b6de047 (patch) | |
tree | 8e2eb60236ae9f718b831f90ea359958ce8a9066 /drivers/s390/cio | |
parent | f95b2c45d5f785f069d186b11b798f9c1d37dcda (diff) | |
download | linux-29c53de014430bbf7febb402afd3f8149b6de047.tar.bz2 |
s390/cio: remove ccw_device_add() wrapper
Set the bus type when initializing the cdev structure. The device core
won't act on it until we call device_add().
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/device.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 4b0a7cbb2096..df46373d67ec 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -621,14 +621,6 @@ static const struct attribute_group *ccwdev_attr_groups[] = { NULL, }; -static int ccw_device_add(struct ccw_device *cdev) -{ - struct device *dev = &cdev->dev; - - dev->bus = &ccw_bus_type; - return device_add(dev); -} - static int match_dev_id(struct device *dev, const void *data) { struct ccw_device *cdev = to_ccwdev(dev); @@ -739,6 +731,7 @@ static int io_subchannel_initialize_dev(struct subchannel *sch, cdev->ccwlock = sch->lock; cdev->dev.parent = &sch->dev; cdev->dev.release = ccw_device_release; + cdev->dev.bus = &ccw_bus_type; cdev->dev.groups = ccwdev_attr_groups; /* Do first half of device_register. */ device_initialize(&cdev->dev); @@ -840,7 +833,7 @@ static void io_subchannel_register(struct ccw_device *cdev) kobject_uevent(&sch->dev.kobj, KOBJ_ADD); } /* make it known to the system */ - ret = ccw_device_add(cdev); + ret = device_add(&cdev->dev); if (ret) { CIO_MSG_EVENT(0, "Could not register ccw dev 0.%x.%04x: %d\n", cdev->private->dev_id.ssid, @@ -1052,7 +1045,7 @@ static int io_subchannel_probe(struct subchannel *sch) kobject_uevent(&sch->dev.kobj, KOBJ_ADD); } cdev = sch_get_cdev(sch); - rc = ccw_device_add(cdev); + rc = device_add(&cdev->dev); if (rc) { /* Release online reference. */ put_device(&cdev->dev); |