aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/scx200_gpio.c
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2006-06-27 05:54:23 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:43 -0400
commitf31000e573da052b6b8bcc21faff520b4e2eda7a (patch)
tree670d5e6e00da615f70d99a950cfe7b8603edad26 /drivers/char/scx200_gpio.c
parent58b087cda1e9e46c7061c2282f92bd8e1970bfe7 (diff)
[PATCH] chardev: GPIO for SCx200 & PC-8736x: use dev_dbg in common module
Use of dev_dbg() and friends is considered good practice. dev_dbg() needs a struct device *devp, but nsc_gpio is only a helper module, so it doesnt have/need its own. To provide devp to the user-modules (scx200 & pc8736x _gpio), we add it to the vtable, and set it during init. Also squeeze nsc_gpio_dump()'s format a little. [ 199.259879] pc8736x_gpio.0: io09: 0x0044 TS OD PUE EDGE LO DEBOUNCE Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/scx200_gpio.c')
-rw-r--r--drivers/char/scx200_gpio.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index 442367b3f5dc..5a280a330401 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -35,14 +35,6 @@ static int major = 0; /* default to dynamic major */
35module_param(major, int, 0); 35module_param(major, int, 0);
36MODULE_PARM_DESC(major, "Major device number"); 36MODULE_PARM_DESC(major, "Major device number");
37 37
38extern void nsc_gpio_dump(unsigned index);
39
40extern ssize_t nsc_gpio_write(struct file *file, const char __user *data,
41 size_t len, loff_t *ppos);
42
43extern ssize_t nsc_gpio_read(struct file *file, char __user *buf,
44 size_t len, loff_t *ppos);
45
46struct nsc_gpio_ops scx200_access = { 38struct nsc_gpio_ops scx200_access = {
47 .owner = THIS_MODULE, 39 .owner = THIS_MODULE,
48 .gpio_config = scx200_gpio_configure, 40 .gpio_config = scx200_gpio_configure,
@@ -101,6 +93,9 @@ static int __init scx200_gpio_init(void)
101 if (rc) 93 if (rc)
102 goto undo_malloc; 94 goto undo_malloc;
103 95
96 /* nsc_gpio uses dev_dbg(), so needs this */
97 scx200_access.dev = &pdev->dev;
98
104 if (major) 99 if (major)
105 rc = register_chrdev_region(dev, num_pins, "scx200_gpio"); 100 rc = register_chrdev_region(dev, num_pins, "scx200_gpio");
106 else { 101 else {