aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2006-07-14 03:24:26 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:54 -0400
commit2e8f7a3128bb8fac8351a994f1fc325717899308 (patch)
tree9c9169220013caa62887a6d40725589f896de0b3
parentabecb6da704a71232a3103c8485c65ceb5fcd9dc (diff)
[PATCH] gpio: rename exported vtables to better match purpose
- rename EXPORTed gpio vtables from {scx200,pc8736x}_access to _gpio_ops new name is much closer to the vtable-name struct nsc_gpio_ops, should be clearer. Also rename the _fops vtable var to _fileops to better disambiguate it from the gpio vtable. 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>
-rw-r--r--drivers/char/pc8736x_gpio.c13
-rw-r--r--drivers/char/scx200_gpio.c12
2 files changed, 12 insertions, 13 deletions
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c
index 0b235a90beef..645eb81cb5a9 100644
--- a/drivers/char/pc8736x_gpio.c
+++ b/drivers/char/pc8736x_gpio.c
@@ -212,7 +212,7 @@ static void pc8736x_gpio_change(unsigned index)
212 pc8736x_gpio_set(index, !pc8736x_gpio_current(index)); 212 pc8736x_gpio_set(index, !pc8736x_gpio_current(index));
213} 213}
214 214
215static struct nsc_gpio_ops pc8736x_access = { 215static struct nsc_gpio_ops pc8736x_gpio_ops = {
216 .owner = THIS_MODULE, 216 .owner = THIS_MODULE,
217 .gpio_config = pc8736x_gpio_configure, 217 .gpio_config = pc8736x_gpio_configure,
218 .gpio_dump = nsc_gpio_dump, 218 .gpio_dump = nsc_gpio_dump,
@@ -221,11 +221,12 @@ static struct nsc_gpio_ops pc8736x_access = {
221 .gpio_change = pc8736x_gpio_change, 221 .gpio_change = pc8736x_gpio_change,
222 .gpio_current = pc8736x_gpio_current 222 .gpio_current = pc8736x_gpio_current
223}; 223};
224EXPORT_SYMBOL(pc8736x_gpio_ops);
224 225
225static int pc8736x_gpio_open(struct inode *inode, struct file *file) 226static int pc8736x_gpio_open(struct inode *inode, struct file *file)
226{ 227{
227 unsigned m = iminor(inode); 228 unsigned m = iminor(inode);
228 file->private_data = &pc8736x_access; 229 file->private_data = &pc8736x_gpio_ops;
229 230
230 dev_dbg(&pdev->dev, "open %d\n", m); 231 dev_dbg(&pdev->dev, "open %d\n", m);
231 232
@@ -234,7 +235,7 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file)
234 return nonseekable_open(inode, file); 235 return nonseekable_open(inode, file);
235} 236}
236 237
237static const struct file_operations pc8736x_gpio_fops = { 238static const struct file_operations pc8736x_gpio_fileops = {
238 .owner = THIS_MODULE, 239 .owner = THIS_MODULE,
239 .open = pc8736x_gpio_open, 240 .open = pc8736x_gpio_open,
240 .write = nsc_gpio_write, 241 .write = nsc_gpio_write,
@@ -276,7 +277,7 @@ static int __init pc8736x_gpio_init(void)
276 dev_err(&pdev->dev, "no device found\n"); 277 dev_err(&pdev->dev, "no device found\n");
277 goto undo_platform_dev_add; 278 goto undo_platform_dev_add;
278 } 279 }
279 pc8736x_access.dev = &pdev->dev; 280 pc8736x_gpio_ops.dev = &pdev->dev;
280 281
281 /* Verify that chip and it's GPIO unit are both enabled. 282 /* Verify that chip and it's GPIO unit are both enabled.
282 My BIOS does this, so I take minimum action here 283 My BIOS does this, so I take minimum action here
@@ -326,7 +327,7 @@ static int __init pc8736x_gpio_init(void)
326 pc8736x_init_shadow(); 327 pc8736x_init_shadow();
327 328
328 /* ignore minor errs, and succeed */ 329 /* ignore minor errs, and succeed */
329 cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fops); 330 cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fileops);
330 cdev_add(&pc8736x_gpio_cdev, devid, PC8736X_GPIO_CT); 331 cdev_add(&pc8736x_gpio_cdev, devid, PC8736X_GPIO_CT);
331 332
332 return 0; 333 return 0;
@@ -353,7 +354,5 @@ static void __exit pc8736x_gpio_cleanup(void)
353 platform_device_put(pdev); 354 platform_device_put(pdev);
354} 355}
355 356
356EXPORT_SYMBOL(pc8736x_access);
357
358module_init(pc8736x_gpio_init); 357module_init(pc8736x_gpio_init);
359module_exit(pc8736x_gpio_cleanup); 358module_exit(pc8736x_gpio_cleanup);
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index f65372b5a656..b956c7babd18 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -35,7 +35,7 @@ MODULE_PARM_DESC(major, "Major device number");
35 35
36#define MAX_PINS 32 /* 64 later, when known ok */ 36#define MAX_PINS 32 /* 64 later, when known ok */
37 37
38struct nsc_gpio_ops scx200_access = { 38struct nsc_gpio_ops scx200_gpio_ops = {
39 .owner = THIS_MODULE, 39 .owner = THIS_MODULE,
40 .gpio_config = scx200_gpio_configure, 40 .gpio_config = scx200_gpio_configure,
41 .gpio_dump = nsc_gpio_dump, 41 .gpio_dump = nsc_gpio_dump,
@@ -44,12 +44,12 @@ struct nsc_gpio_ops scx200_access = {
44 .gpio_change = scx200_gpio_change, 44 .gpio_change = scx200_gpio_change,
45 .gpio_current = scx200_gpio_current 45 .gpio_current = scx200_gpio_current
46}; 46};
47EXPORT_SYMBOL(scx200_access); 47EXPORT_SYMBOL(scx200_gpio_ops);
48 48
49static int scx200_gpio_open(struct inode *inode, struct file *file) 49static int scx200_gpio_open(struct inode *inode, struct file *file)
50{ 50{
51 unsigned m = iminor(inode); 51 unsigned m = iminor(inode);
52 file->private_data = &scx200_access; 52 file->private_data = &scx200_gpio_ops;
53 53
54 if (m >= MAX_PINS) 54 if (m >= MAX_PINS)
55 return -EINVAL; 55 return -EINVAL;
@@ -61,7 +61,7 @@ static int scx200_gpio_release(struct inode *inode, struct file *file)
61 return 0; 61 return 0;
62} 62}
63 63
64static const struct file_operations scx200_gpio_fops = { 64static const struct file_operations scx200_gpio_fileops = {
65 .owner = THIS_MODULE, 65 .owner = THIS_MODULE,
66 .write = nsc_gpio_write, 66 .write = nsc_gpio_write,
67 .read = nsc_gpio_read, 67 .read = nsc_gpio_read,
@@ -91,7 +91,7 @@ static int __init scx200_gpio_init(void)
91 goto undo_malloc; 91 goto undo_malloc;
92 92
93 /* nsc_gpio uses dev_dbg(), so needs this */ 93 /* nsc_gpio uses dev_dbg(), so needs this */
94 scx200_access.dev = &pdev->dev; 94 scx200_gpio_ops.dev = &pdev->dev;
95 95
96 if (major) { 96 if (major) {
97 devid = MKDEV(major, 0); 97 devid = MKDEV(major, 0);
@@ -105,7 +105,7 @@ static int __init scx200_gpio_init(void)
105 goto undo_platform_device_add; 105 goto undo_platform_device_add;
106 } 106 }
107 107
108 cdev_init(&scx200_gpio_cdev, &scx200_gpio_fops); 108 cdev_init(&scx200_gpio_cdev, &scx200_gpio_fileops);
109 cdev_add(&scx200_gpio_cdev, devid, MAX_PINS); 109 cdev_add(&scx200_gpio_cdev, devid, MAX_PINS);
110 110
111 return 0; /* succeed */ 111 return 0; /* succeed */