aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cpia_pp.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /drivers/media/video/cpia_pp.c
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'drivers/media/video/cpia_pp.c')
-rw-r--r--drivers/media/video/cpia_pp.c49
1 files changed, 7 insertions, 42 deletions
diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c
index b12cec94f4cc..19711aaf9a3e 100644
--- a/drivers/media/video/cpia_pp.c
+++ b/drivers/media/video/cpia_pp.c
@@ -62,7 +62,6 @@ static int cpia_pp_close(void *privdata);
62#define PPCPIA_PARPORT_OFF -2 62#define PPCPIA_PARPORT_OFF -2
63#define PPCPIA_PARPORT_NONE -1 63#define PPCPIA_PARPORT_NONE -1
64 64
65#ifdef MODULE
66static int parport_nr[PARPORT_MAX] = {[0 ... PARPORT_MAX - 1] = PPCPIA_PARPORT_UNSPEC}; 65static int parport_nr[PARPORT_MAX] = {[0 ... PARPORT_MAX - 1] = PPCPIA_PARPORT_UNSPEC};
67static char *parport[PARPORT_MAX] = {NULL,}; 66static char *parport[PARPORT_MAX] = {NULL,};
68 67
@@ -72,11 +71,6 @@ MODULE_LICENSE("GPL");
72 71
73module_param_array(parport, charp, NULL, 0); 72module_param_array(parport, charp, NULL, 0);
74MODULE_PARM_DESC(parport, "'auto' or a list of parallel port numbers. Just like lp."); 73MODULE_PARM_DESC(parport, "'auto' or a list of parallel port numbers. Just like lp.");
75#else
76static int parport_nr[PARPORT_MAX] __initdata =
77 {[0 ... PARPORT_MAX - 1] = PPCPIA_PARPORT_UNSPEC};
78static int parport_ptr = 0;
79#endif
80 74
81struct pp_cam_entry { 75struct pp_cam_entry {
82 struct pardevice *pdev; 76 struct pardevice *pdev;
@@ -141,7 +135,6 @@ static void cpia_pp_run_callback(struct work_struct *work)
141 cam = container_of(work, struct pp_cam_entry, cb_task); 135 cam = container_of(work, struct pp_cam_entry, cb_task);
142 cb_func = cam->cb_func; 136 cb_func = cam->cb_func;
143 cb_data = cam->cb_data; 137 cb_data = cam->cb_data;
144 work_release(work);
145 138
146 cb_func(cb_data); 139 cb_func(cb_data);
147} 140}
@@ -682,7 +675,7 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo
682 if(cam->port->irq != PARPORT_IRQ_NONE) { 675 if(cam->port->irq != PARPORT_IRQ_NONE) {
683 cam->cb_func = cb; 676 cam->cb_func = cb;
684 cam->cb_data = cbdata; 677 cam->cb_data = cbdata;
685 INIT_WORK_NAR(&cam->cb_task, cpia_pp_run_callback); 678 INIT_WORK(&cam->cb_task, cpia_pp_run_callback);
686 } else { 679 } else {
687 retval = -1; 680 retval = -1;
688 } 681 }
@@ -820,7 +813,7 @@ static struct parport_driver cpia_pp_driver = {
820 .detach = cpia_pp_detach, 813 .detach = cpia_pp_detach,
821}; 814};
822 815
823static int cpia_pp_init(void) 816static int __init cpia_pp_init(void)
824{ 817{
825 printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 818 printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT,
826 CPIA_PP_MAJ_VER,CPIA_PP_MIN_VER,CPIA_PP_PATCH_VER); 819 CPIA_PP_MAJ_VER,CPIA_PP_MIN_VER,CPIA_PP_PATCH_VER);
@@ -839,8 +832,7 @@ static int cpia_pp_init(void)
839 return 0; 832 return 0;
840} 833}
841 834
842#ifdef MODULE 835static int __init cpia_init(void)
843int init_module(void)
844{ 836{
845 if (parport[0]) { 837 if (parport[0]) {
846 /* The user gave some parameters. Let's see what they were. */ 838 /* The user gave some parameters. Let's see what they were. */
@@ -867,38 +859,11 @@ int init_module(void)
867 return cpia_pp_init(); 859 return cpia_pp_init();
868} 860}
869 861
870void cleanup_module(void) 862static void __exit cpia_cleanup(void)
871{ 863{
872 parport_unregister_driver (&cpia_pp_driver); 864 parport_unregister_driver(&cpia_pp_driver);
873 return; 865 return;
874} 866}
875 867
876#else /* !MODULE */ 868module_init(cpia_init);
877 869module_exit(cpia_cleanup);
878static int __init cpia_pp_setup(char *str)
879{
880 int err;
881
882 if (!strncmp(str, "parport", 7)) {
883 int n = simple_strtoul(str + 7, NULL, 10);
884 if (parport_ptr < PARPORT_MAX) {
885 parport_nr[parport_ptr++] = n;
886 } else {
887 LOG("too many ports, %s ignored.\n", str);
888 }
889 } else if (!strcmp(str, "auto")) {
890 parport_nr[0] = PPCPIA_PARPORT_AUTO;
891 } else if (!strcmp(str, "none")) {
892 parport_nr[parport_ptr++] = PPCPIA_PARPORT_NONE;
893 }
894
895 err=cpia_pp_init();
896 if (err)
897 return err;
898
899 return 1;
900}
901
902__setup("cpia_pp=", cpia_pp_setup);
903
904#endif /* !MODULE */