/* We will call this function to format the output of the layer attribute file.  */
static ssize_t pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
/* We will call this function to format the output of the layer attribute file.  */
static ssize_t pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
{
	char *out = buf;
	struct device_path *devpath;
	short i;
	if (!entry || !buf)
		return -EINVAL;
	read_lock(&entry->rw_lock);
	devpath = &entry->devpath;
	i = entry->ready;
	read_unlock(&entry->rw_lock);
	if (!i)
		return -ENODATA;
	for (i = 0; i < 6 && devpath->layers[i]; i++)
		out += sprintf(out, "%u ", devpath->layers[i]);
	out += sprintf(out, "\n");
	return out - buf;
}