|
@@ -303,7 +303,7 @@ int ccw_device_is_orphan(struct ccw_device *cdev)
|
|
|
|
|
|
static void ccw_device_unregister(struct ccw_device *cdev)
|
|
|
{
|
|
|
- if (test_and_clear_bit(1, &cdev->private->registered)) {
|
|
|
+ if (device_is_registered(&cdev->dev)) {
|
|
|
device_del(&cdev->dev);
|
|
|
/* Release reference from device_initialize(). */
|
|
|
put_device(&cdev->dev);
|
|
@@ -640,12 +640,7 @@ static int ccw_device_register(struct ccw_device *cdev)
|
|
|
cdev->private->dev_id.devno);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
- ret = device_add(dev);
|
|
|
- if (ret)
|
|
|
- return ret;
|
|
|
-
|
|
|
- set_bit(1, &cdev->private->registered);
|
|
|
- return ret;
|
|
|
+ return device_add(dev);
|
|
|
}
|
|
|
|
|
|
static int match_dev_id(struct device *dev, void *data)
|
|
@@ -669,7 +664,7 @@ static void ccw_device_do_unbind_bind(struct ccw_device *cdev)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
|
- if (test_bit(1, &cdev->private->registered)) {
|
|
|
+ if (device_is_registered(&cdev->dev)) {
|
|
|
device_release_driver(&cdev->dev);
|
|
|
ret = device_attach(&cdev->dev);
|
|
|
WARN_ON(ret == -ENODEV);
|