Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337216
b: refs/heads/master
c: cf7d9b4
h: refs/heads/master
v: v3
  • Loading branch information
YAMANE Toshiaki authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent cf01e63 commit 6978a62
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a00ab999eb8cd0766277bac8f8209bda9bbbb87
refs/heads/master: cf7d9b4231e5d505084e1438192b27ad6b82dd00
44 changes: 21 additions & 23 deletions trunk/drivers/staging/comedi/drivers/unioxx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Devices: [Fastwel] UNIOxx-5 (unioxx5),
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "../comedidev.h"
#include <linux/ioport.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -144,8 +146,7 @@ static int __unioxx5_digital_read(struct unioxx5_subd_priv *usp,

channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
printk(KERN_ERR
"comedi%d: undefined channel %d. channel range is 0 .. 23\n",
pr_err("comedi%d: undefined channel %d. channel range is 0 .. 23\n",
minor, channel);
return 0;
}
Expand All @@ -171,8 +172,7 @@ static int __unioxx5_analog_read(struct unioxx5_subd_priv *usp,

/* defining if given module can work on input */
if (usp->usp_module_type[module_no] & MODULE_OUTPUT_MASK) {
printk(KERN_ERR
"comedi%d: module in position %d with id 0x%02x is for output only",
pr_err("comedi%d: module in position %d with id 0x%02x is for output only",
minor, module_no, usp->usp_module_type[module_no]);
return 0;
}
Expand Down Expand Up @@ -209,8 +209,7 @@ static int __unioxx5_digital_write(struct unioxx5_subd_priv *usp,

channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
printk(KERN_ERR
"comedi%d: undefined channel %d. channel range is 0 .. 23\n",
pr_err("comedi%d: undefined channel %d. channel range is 0 .. 23\n",
minor, channel);
return 0;
}
Expand Down Expand Up @@ -240,8 +239,7 @@ static int __unioxx5_analog_write(struct unioxx5_subd_priv *usp,

/* defining if given module can work on output */
if (!(usp->usp_module_type[module] & MODULE_OUTPUT_MASK)) {
printk(KERN_ERR
"comedi%d: module in position %d with id 0x%0x is for input only!\n",
pr_err("comedi%d: module in position %d with id 0x%0x is for input only!\n",
minor, module, usp->usp_module_type[module]);
return 0;
}
Expand Down Expand Up @@ -323,17 +321,17 @@ static int unioxx5_insn_config(struct comedi_device *dev,
type = usp->usp_module_type[channel / 2];

if (type != MODULE_DIGITAL) {
printk(KERN_ERR
"comedi%d: channel configuration accessible only for digital modules\n",
dev->minor);
dev_err(dev->class_dev,
"comedi%d: channel configuration accessible only for digital modules\n",
dev->minor);
return -1;
}

channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
printk(KERN_ERR
"comedi%d: undefined channel %d. channel range is 0 .. 23\n",
dev->minor, channel);
dev_err(dev->class_dev,
"comedi%d: undefined channel %d. channel range is 0 .. 23\n",
dev->minor, channel);
return -1;
}

Expand All @@ -348,7 +346,8 @@ static int unioxx5_insn_config(struct comedi_device *dev,
flags |= mask;
break;
default:
printk(KERN_ERR "comedi%d: unknown flag\n", dev->minor);
dev_err(dev->class_dev,
"comedi%d: unknown flag\n", dev->minor);
return -1;
}

Expand All @@ -375,19 +374,21 @@ static int __unioxx5_subdev_init(struct comedi_subdevice *subdev,
int i, to, ndef_flag = 0;

if (!request_region(subdev_iobase, UNIOXX5_SIZE, DRIVER_NAME)) {
printk(KERN_ERR "comedi%d: I/O port conflict\n", minor);
dev_err(subdev->class_dev,
"comedi%d: I/O port conflict\n", minor);
return -EIO;
}

usp = kzalloc(sizeof(*usp), GFP_KERNEL);

if (usp == NULL) {
printk(KERN_ERR "comedi%d: error! --> out of memory!\n", minor);
dev_err(subdev->class_dev,
"comedi%d: error! --> out of memory!\n", minor);
return -1;
}

usp->usp_iobase = subdev_iobase;
printk(KERN_INFO "comedi%d: |", minor);
dev_info(subdev->class_dev, "comedi%d: |", minor);

/* defining modules types */
for (i = 0; i < 12; i++) {
Expand Down Expand Up @@ -433,8 +434,6 @@ static int __unioxx5_subdev_init(struct comedi_subdevice *subdev,
/* for digital modules only!!! */
subdev->insn_config = unioxx5_insn_config;

printk(KERN_INFO "subdevice configured\n");

return 0;
}

Expand Down Expand Up @@ -464,8 +463,8 @@ static int unioxx5_attach(struct comedi_device *dev,

/* unioxx5 can has from two to four subdevices */
if (n_subd < 2) {
printk(KERN_ERR
"your card must has at least 2 'g01' subdevices\n");
dev_err(dev->class_dev,
"your card must has at least 2 'g01' subdevices\n");
return -1;
}

Expand All @@ -480,7 +479,6 @@ static int unioxx5_attach(struct comedi_device *dev,
return -1;
}

printk(KERN_INFO "attached\n");
return 0;
}

Expand Down

0 comments on commit 6978a62

Please sign in to comment.