/* Return dasd_device structure associated with cdev. This function needs to be called with the ccw device lock held. It can be used from interrupt context.  */
struct dasd_device* dasd_device_from_cdev_locked(struct ccw_device *cdev)
/* Return dasd_device structure associated with cdev. This function needs to be called with the ccw device lock held. It can be used from interrupt context.  */
struct dasd_device* dasd_device_from_cdev_locked(struct ccw_device *cdev)
{
	struct dasd_device *device = dev_get_drvdata(&cdev->dev);
	if (!device)
		return ERR_PTR(-ENODEV);
	dasd_get_device(device);
	return device;
}