Commit f48b702d authored by Federico Vaga's avatar Federico Vaga

trivial: reword/add some dev_dbg messages

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 998f7bb3
......@@ -274,6 +274,8 @@ static int zio_read_mask(struct zio_f_priv *priv)
struct zio_bi *bi = chan->bi;
const int can_read = POLLIN | POLLRDNORM;
dev_dbg(&bi->head.dev, "%s: channel %d in cset %d", __func__,
bi->chan->index, bi->chan->cset->index);
if (!chan->user_block)
chan->user_block = bi->b_op->retr_block(bi);
if (!chan->user_block)
......@@ -310,6 +312,9 @@ static int zio_write_mask(struct zio_f_priv *priv)
struct zio_block *block = chan->user_block;
const int can_write = POLLOUT | POLLWRNORM;
dev_dbg(&bi->head.dev, "%s: channel %d in cset %d", __func__,
bi->chan->index, bi->chan->cset->index);
if (unlikely(priv->type == ZIO_CDEV_CTRL)) {
/* A control can be replaced before store */
if (block)
......@@ -343,7 +348,7 @@ static ssize_t zio_generic_read(struct file *f, char __user *ubuf,
struct zio_bi *bi = chan->bi;
struct zio_block *block;
pr_debug("%s:%d type %s\n", __func__, __LINE__,
dev_dbg(&bi->head.dev, "%s:%d type %s\n", __func__, __LINE__,
priv->type == ZIO_CDEV_CTRL ? "ctrl" : "data");
if ((bi->flags & ZIO_DIR) == ZIO_DIR_OUTPUT)
......@@ -392,7 +397,7 @@ static ssize_t zio_generic_write(struct file *f, const char __user *ubuf,
struct zio_bi *bi = chan->bi;
struct zio_block *block;
pr_debug("%s:%d type %s\n", __func__, __LINE__,
dev_dbg(&bi->head.dev, "%s:%d type %s\n", __func__, __LINE__,
priv->type == ZIO_CDEV_CTRL ? "ctrl" : "data");
if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT)
......@@ -443,6 +448,8 @@ static int zio_generic_mmap(struct file *f, struct vm_area_struct *vma)
struct zio_bi *bi = priv->chan->bi;
const struct vm_operations_struct *v_op = bi->v_op;
dev_dbg(&bi->head.dev, "%s: channel %d in cset %d", __func__,
bi->chan->index, bi->chan->cset->index);
if (!v_op)
return -ENODEV; /* according to man page */
/* The buffer instance may usecount, so notifiy it and allow
......@@ -459,6 +466,8 @@ static unsigned int zio_generic_poll(struct file *f,
struct zio_f_priv *priv = f->private_data;
struct zio_bi *bi = priv->chan->bi;
dev_dbg(&bi->head.dev, "%s: channel %d in cset %d", __func__,
bi->chan->index, bi->chan->cset->index);
poll_wait(f, &bi->q, w);
if ((bi->flags & ZIO_DIR) == ZIO_DIR_OUTPUT)
return zio_write_mask(priv);
......
......@@ -342,7 +342,7 @@ static void __zobj_enable(struct device *dev, unsigned int enable)
struct zio_cset *cset;
struct zio_ti *ti;
pr_debug("%s\n", __func__);
dev_dbg(dev, "enable = %d\n", enable);
head = to_zio_head(dev);
zf = zio_get_from_obj(to_zio_head(dev), flags);
......@@ -354,7 +354,7 @@ static void __zobj_enable(struct device *dev, unsigned int enable)
*zf = (*zf & (~ZIO_STATUS)) | status;
switch (head->zobj_type) {
case ZIO_DEV:
pr_debug("%s: zdev\n", __func__);
dev_dbg(dev, "(dev)\n");
zdev = to_zio_dev(dev);
/* enable/disable all cset */
......@@ -363,7 +363,7 @@ static void __zobj_enable(struct device *dev, unsigned int enable)
/* device callback */
break;
case ZIO_CSET:
pr_debug("%s: zcset\n", __func__);
dev_dbg(dev, "(cset)\n");
cset = to_zio_cset(dev);
/* enable/disable trigger instance */
......@@ -374,11 +374,12 @@ static void __zobj_enable(struct device *dev, unsigned int enable)
/* cset callback */
break;
case ZIO_CHAN:
pr_debug("%s: zchan\n", __func__);
dev_dbg(dev, "(chan)\n");
/* channel callback */
break;
case ZIO_TI:
pr_debug("%s: zti\n", __func__);
dev_dbg(dev, "(ti)\n");
ti = to_zio_ti(dev);
zio_trigger_abort_disable(ti->cset, 0);
......@@ -392,7 +393,7 @@ static void __zobj_enable(struct device *dev, unsigned int enable)
case ZIO_BUF:
case ZIO_TRG:
case ZIO_BI:
pr_debug("%s: others\n", __func__);
dev_dbg(dev, "(buf)\n");
/* buffer instance callback */
break;
default:
......@@ -427,6 +428,7 @@ static ssize_t zobj_store_cur_trig(struct device *dev,
struct zio_cset *cset;
int err = 0;
dev_dbg(dev, "Changing trigger to: %s\n", buf);
if (strlen(buf) > ZIO_OBJ_NAME_LEN+1)
return -EINVAL; /* name too long */
sscanf(buf, "%s\n", buf_tmp);
......@@ -451,6 +453,7 @@ static ssize_t zobj_store_cur_zbuf(struct device *dev,
struct zio_cset *cset;
int err = 0;
dev_dbg(dev, "Changing buffer to: %s\n", buf);
if (strlen(buf) > ZIO_OBJ_NAME_LEN+1)
return -EINVAL; /* name too long */
sscanf(buf, "%s\n", buf_tmp);
......@@ -508,7 +511,6 @@ static ssize_t zattr_show(struct device *dev, struct device_attribute *attr,
struct zio_attribute *zattr = to_zio_zattr(attr);
ssize_t len = 0;
pr_debug("%s\n", __func__);
if (!zattr->s_op)
goto out;
......@@ -524,6 +526,9 @@ static ssize_t zattr_show(struct device *dev, struct device_attribute *attr,
if (err)
return err;
}
dev_dbg(dev, "read value %d from sysfs attribute %s\n",
zattr->value, attr->attr.name);
out:
len = sprintf(buf, "%i\n", zattr->value);
return len;
......@@ -547,6 +552,9 @@ static ssize_t zattr_store(struct device *dev, struct device_attribute *attr,
if (!zattr->s_op->conf_set)
return -EINVAL;
dev_dbg(dev, "writing value %ld to sysfs attribute %s\n",
val, attr->attr.name);
lock = __get_spinlock(head);
spin_lock(lock);
err = zattr->s_op->conf_set(dev, zattr, (uint32_t)val);
......@@ -978,6 +986,8 @@ int zattr_set_create(struct zio_obj_head *head,
zattr = &zattr_set->std_zattr[i];
attr = &zattr->attr.attr;
err = __check_attr(attr, s_op);
dev_vdbg(&head->dev, "%s(std): %s %d %s\n", __func__, head->name, i,
attr->name);
switch (err) {
case 0:
/* valid attribute */
......@@ -1012,6 +1022,8 @@ ext:
err = __check_attr(attr, s_op);
if (err)
return err;
dev_vdbg(&head->dev, "%s(ext): %s %d %s\n", __func__, head->name, i,
attr->name);
/* valid attribute */
groups[g]->attrs[a_count++] = attr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment