/* The fops implementation of the character device driver  */
static ssize_t do_write(struct urdev *urd, const char __user *udata, size_t count, size_t reclen, loff_t *ppos)
/* The fops implementation of the character device driver  */
static ssize_t do_write(struct urdev *urd, const char __user *udata, size_t count, size_t reclen, loff_t *ppos)
{
	struct ccw1 *cpa;
	int rc;
	cpa = alloc_chan_prog(udata, count / reclen, reclen);
	if (IS_ERR(cpa))
		return PTR_ERR(cpa);
	rc = do_ur_io(urd, cpa);
	if (rc)
		goto fail_kfree_cpa;
	if (urd->io_request_rc) {
		rc = urd->io_request_rc;
		goto fail_kfree_cpa;
	}
	*ppos += count;
	rc = count;
fail_kfree_cpa:
	free_chan_prog(cpa);
	return rc;
}