summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorHaneen Mohammed2015-03-17 06:33:51 +0100
committerGreg Kroah-Hartman2015-03-18 11:16:36 +0100
commita112eab4d5e78433a7c65b5703ad177cdabc6588 (patch)
tree23c3270d186eae68e55654ba4cca5cb0faeda905 /drivers/staging/comedi/comedi_fops.c
parentStaging: media: Use module_i2c_driver (diff)
downloadkernel-qcow2-linux-a112eab4d5e78433a7c65b5703ad177cdabc6588.tar.gz
kernel-qcow2-linux-a112eab4d5e78433a7c65b5703ad177cdabc6588.tar.xz
kernel-qcow2-linux-a112eab4d5e78433a7c65b5703ad177cdabc6588.zip
Staging: comedi: replace pr_err with dev_err
This patch replace pr_err with dev_err, when appropriate device structure is found. Issue found using the following Coccinelle script: @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, fld; @@ struct s { ... struct device *fld; ... }; @@ identifier r.i, rr.fld; position r.p; @@ -pr_err@p +dev_err ( + i->fld, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 2f8257cd9824..8bf57b736659 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2700,7 +2700,8 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
mutex_unlock(&dev->mutex);
comedi_device_cleanup(dev);
comedi_dev_put(dev);
- pr_err("ran out of minor numbers for board device files\n");
+ dev_err(hardware_device,
+ "ran out of minor numbers for board device files\n");
return ERR_PTR(-EBUSY);
}
dev->minor = i;
@@ -2753,7 +2754,8 @@ int comedi_alloc_subdevice_minor(struct comedi_subdevice *s)
}
mutex_unlock(&comedi_subdevice_minor_table_lock);
if (i == COMEDI_NUM_SUBDEVICE_MINORS) {
- pr_err("ran out of minor numbers for subdevice files\n");
+ dev_err(dev->class_dev,
+ "ran out of minor numbers for subdevice files\n");
return -EBUSY;
}
i += COMEDI_NUM_BOARD_MINORS;