Skip to content

Commit

Permalink
s390/char: fix cdev_add usage
Browse files Browse the repository at this point in the history
Function cdev_add does set cdev->dev, so there is no point in setting
it prior to calling this function.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
jdelvare authored and Martin Schwidefsky committed Sep 28, 2017
1 parent e16c5dd commit b08e19d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/s390/char/tape_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ struct tape_class_device *register_tape_dev(

tcd->char_device->owner = fops->owner;
tcd->char_device->ops = fops;
tcd->char_device->dev = dev;

rc = cdev_add(tcd->char_device, tcd->char_device->dev, 1);
rc = cdev_add(tcd->char_device, dev, 1);
if (rc)
goto fail_with_cdev;

Expand Down
3 changes: 1 addition & 2 deletions drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,7 @@ static int vmlogrdr_register_cdev(dev_t dev)
}
vmlogrdr_cdev->owner = THIS_MODULE;
vmlogrdr_cdev->ops = &vmlogrdr_fops;
vmlogrdr_cdev->dev = dev;
rc = cdev_add(vmlogrdr_cdev, vmlogrdr_cdev->dev, MAXMINOR);
rc = cdev_add(vmlogrdr_cdev, dev, MAXMINOR);
if (!rc)
return 0;

Expand Down
3 changes: 1 addition & 2 deletions drivers/s390/char/vmur.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,9 @@ static int ur_set_online(struct ccw_device *cdev)
}

urd->char_device->ops = &ur_fops;
urd->char_device->dev = MKDEV(major, minor);
urd->char_device->owner = ur_fops.owner;

rc = cdev_add(urd->char_device, urd->char_device->dev, 1);
rc = cdev_add(urd->char_device, MKDEV(major, minor), 1);
if (rc)
goto fail_free_cdev;
if (urd->cdev->id.cu_type == READER_PUNCH_DEVTYPE) {
Expand Down

0 comments on commit b08e19d

Please sign in to comment.