Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b08e19de authored by Jean Delvare's avatar Jean Delvare Committed by Martin Schwidefsky
Browse files

s390/char: fix cdev_add usage



Function cdev_add does set cdev->dev, so there is no point in setting
it prior to calling this function.

Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e16c5dd5
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -68,9 +68,8 @@ struct tape_class_device *register_tape_dev(


	tcd->char_device->owner = fops->owner;
	tcd->char_device->owner = fops->owner;
	tcd->char_device->ops   = fops;
	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)
	if (rc)
		goto fail_with_cdev;
		goto fail_with_cdev;


+1 −2
Original line number Original line Diff line number Diff line
@@ -812,8 +812,7 @@ static int vmlogrdr_register_cdev(dev_t dev)
	}
	}
	vmlogrdr_cdev->owner = THIS_MODULE;
	vmlogrdr_cdev->owner = THIS_MODULE;
	vmlogrdr_cdev->ops = &vmlogrdr_fops;
	vmlogrdr_cdev->ops = &vmlogrdr_fops;
	vmlogrdr_cdev->dev = dev;
	rc = cdev_add(vmlogrdr_cdev, dev, MAXMINOR);
	rc = cdev_add(vmlogrdr_cdev, vmlogrdr_cdev->dev, MAXMINOR);
	if (!rc)
	if (!rc)
		return 0;
		return 0;


+1 −2
Original line number Original line Diff line number Diff line
@@ -892,10 +892,9 @@ static int ur_set_online(struct ccw_device *cdev)
	}
	}


	urd->char_device->ops = &ur_fops;
	urd->char_device->ops = &ur_fops;
	urd->char_device->dev = MKDEV(major, minor);
	urd->char_device->owner = ur_fops.owner;
	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)
	if (rc)
		goto fail_free_cdev;
		goto fail_free_cdev;
	if (urd->cdev->id.cu_type == READER_PUNCH_DEVTYPE) {
	if (urd->cdev->id.cu_type == READER_PUNCH_DEVTYPE) {