/* Copy and IOCTL return string to user space  */
static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
/* Copy and IOCTL return string to user space  */
static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
{
	int len;
	len = strlen(value);
	if (len > *buf_len)
		len = *buf_len;
	*buf_len = strlen(value);
	if (len && buf)
		if (copy_to_user(buf, value, len))
			return -EFAULT;
	return 0;
}