/* All flags specified in @flags are set, the remainder is left untouched. Returns: %0 on success, -EINVAL if an invalid flag combination would ensue.  */
int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
/* All flags specified in @flags are set, the remainder is left untouched. Returns: %0 on success, -EINVAL if an invalid flag combination would ensue.  */
int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
{
	if (((flags & CCWDEV_EARLY_NOTIFICATION) &&
	    (flags & CCWDEV_REPORT_ALL)) ||
	    ((flags & CCWDEV_EARLY_NOTIFICATION) &&
	     cdev->private->options.repall) ||
	    ((flags & CCWDEV_REPORT_ALL) &&
	     cdev->private->options.fast))
		return -EINVAL;
	cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0;
	cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0;
	cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0;
	cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0;
	cdev->private->options.mpath |= (flags & CCWDEV_DO_MULTIPATH) != 0;
	return 0;
}