aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
commit2fca877b68b2b4fc5b94277858a1bedd46017cde (patch)
treefd02725406299ba2f26354463b3c261721e9eb6b /drivers/parport
parentff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (diff)
parent02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff)
/spare/repo/libata-dev branch 'v2.6.13'
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/Kconfig2
-rw-r--r--drivers/parport/parport_cs.c16
-rw-r--r--drivers/parport/parport_pc.c6
-rw-r--r--drivers/parport/parport_serial.c5
-rw-r--r--drivers/parport/probe.c18
5 files changed, 21 insertions, 26 deletions
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
index 16a2e6ae37f4..725a14119f2a 100644
--- a/drivers/parport/Kconfig
+++ b/drivers/parport/Kconfig
@@ -34,7 +34,7 @@ config PARPORT
34 34
35config PARPORT_PC 35config PARPORT_PC
36 tristate "PC-style hardware" 36 tristate "PC-style hardware"
37 depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 37 depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 && !M32R
38 ---help--- 38 ---help---
39 You should say Y here if you have a PC-style parallel port. All 39 You should say Y here if you have a PC-style parallel port. All
40 IBM PC compatible computers and some Alphas have PC-style 40 IBM PC compatible computers and some Alphas have PC-style
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index a3fa8185af2a..24e6aacddb74 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -48,7 +48,6 @@
48#include <linux/parport.h> 48#include <linux/parport.h>
49#include <linux/parport_pc.h> 49#include <linux/parport_pc.h>
50 50
51#include <pcmcia/version.h>
52#include <pcmcia/cs_types.h> 51#include <pcmcia/cs_types.h>
53#include <pcmcia/cs.h> 52#include <pcmcia/cs.h>
54#include <pcmcia/cistpl.h> 53#include <pcmcia/cistpl.h>
@@ -133,11 +132,6 @@ static dev_link_t *parport_attach(void)
133 link->next = dev_list; 132 link->next = dev_list;
134 dev_list = link; 133 dev_list = link;
135 client_reg.dev_info = &dev_info; 134 client_reg.dev_info = &dev_info;
136 client_reg.EventMask =
137 CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
138 CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
139 CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
140 client_reg.event_handler = &parport_event;
141 client_reg.Version = 0x0210; 135 client_reg.Version = 0x0210;
142 client_reg.event_callback_args.client_data = link; 136 client_reg.event_callback_args.client_data = link;
143 ret = pcmcia_register_client(&link->handle, &client_reg); 137 ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -373,13 +367,23 @@ int parport_event(event_t event, int priority,
373 return 0; 367 return 0;
374} /* parport_event */ 368} /* parport_event */
375 369
370static struct pcmcia_device_id parport_ids[] = {
371 PCMCIA_DEVICE_FUNC_ID(3),
372 PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
373 PCMCIA_DEVICE_NULL
374};
375MODULE_DEVICE_TABLE(pcmcia, parport_ids);
376
376static struct pcmcia_driver parport_cs_driver = { 377static struct pcmcia_driver parport_cs_driver = {
377 .owner = THIS_MODULE, 378 .owner = THIS_MODULE,
378 .drv = { 379 .drv = {
379 .name = "parport_cs", 380 .name = "parport_cs",
380 }, 381 },
381 .attach = parport_attach, 382 .attach = parport_attach,
383 .event = parport_event,
382 .detach = parport_detach, 384 .detach = parport_detach,
385 .id_table = parport_ids,
386
383}; 387};
384 388
385static int __init init_parport_cs(void) 389static int __init init_parport_cs(void)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index e7f3bcb79000..4598c6a9212d 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2751,7 +2751,6 @@ enum parport_pc_pci_cards {
2751 netmos_9755, 2751 netmos_9755,
2752 netmos_9805, 2752 netmos_9805,
2753 netmos_9815, 2753 netmos_9815,
2754 netmos_9855,
2755}; 2754};
2756 2755
2757 2756
@@ -2826,7 +2825,6 @@ static struct parport_pc_pci {
2826 /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* untested */ 2825 /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* untested */
2827 /* netmos_9805 */ { 1, { { 0, -1 }, } }, /* untested */ 2826 /* netmos_9805 */ { 1, { { 0, -1 }, } }, /* untested */
2828 /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */ 2827 /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */
2829 /* netmos_9855 */ { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */
2830}; 2828};
2831 2829
2832static struct pci_device_id parport_pc_pci_tbl[] = { 2830static struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2907,8 +2905,6 @@ static struct pci_device_id parport_pc_pci_tbl[] = {
2907 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 }, 2905 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 },
2908 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815, 2906 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815,
2909 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 }, 2907 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 },
2910 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
2911 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
2912 { 0, } /* terminate list */ 2908 { 0, } /* terminate list */
2913}; 2909};
2914MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl); 2910MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
@@ -3012,7 +3008,7 @@ static int __init parport_pc_init_superio (int autoirq, int autodma)
3012 int ret = 0; 3008 int ret = 0;
3013 3009
3014 while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { 3010 while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
3015 id = pci_match_device (parport_pc_pci_tbl, pdev); 3011 id = pci_match_id(parport_pc_pci_tbl, pdev);
3016 if (id == NULL || id->driver_data >= last_sio) 3012 if (id == NULL || id->driver_data >= last_sio)
3017 continue; 3013 continue;
3018 3014
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 6715a17b5d0f..00498e2f1205 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -34,6 +34,7 @@ enum parport_pc_pci_cards {
34 titan_110l = 0, 34 titan_110l = 0,
35 titan_210l, 35 titan_210l,
36 netmos_9xx5_combo, 36 netmos_9xx5_combo,
37 netmos_9855,
37 avlab_1s1p, 38 avlab_1s1p,
38 avlab_1s1p_650, 39 avlab_1s1p_650,
39 avlab_1s1p_850, 40 avlab_1s1p_850,
@@ -87,6 +88,7 @@ static struct parport_pc_pci cards[] __devinitdata = {
87 /* titan_110l */ { 1, { { 3, -1 }, } }, 88 /* titan_110l */ { 1, { { 3, -1 }, } },
88 /* titan_210l */ { 1, { { 3, -1 }, } }, 89 /* titan_210l */ { 1, { { 3, -1 }, } },
89 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init }, 90 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init },
91 /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init },
90 /* avlab_1s1p */ { 1, { { 1, 2}, } }, 92 /* avlab_1s1p */ { 1, { { 1, 2}, } },
91 /* avlab_1s1p_650 */ { 1, { { 1, 2}, } }, 93 /* avlab_1s1p_650 */ { 1, { { 1, 2}, } },
92 /* avlab_1s1p_850 */ { 1, { { 1, 2}, } }, 94 /* avlab_1s1p_850 */ { 1, { { 1, 2}, } },
@@ -120,7 +122,7 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
120 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845, 122 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
121 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo }, 123 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
122 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855, 124 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
123 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo }, 125 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
124 /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/ 126 /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
125 { 0x14db, 0x2110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p}, 127 { 0x14db, 0x2110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p},
126 { 0x14db, 0x2111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p_650}, 128 { 0x14db, 0x2111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p_650},
@@ -207,6 +209,7 @@ static struct pci_board_no_ids pci_boards[] __devinitdata = {
207/* titan_110l */ { SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 1, 921600 }, 209/* titan_110l */ { SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 1, 921600 },
208/* titan_210l */ { SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 2, 921600 }, 210/* titan_210l */ { SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 2, 921600 },
209/* netmos_9xx5_combo */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200, 0, 0, netmos_serial_init }, 211/* netmos_9xx5_combo */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200, 0, 0, netmos_serial_init },
212/* netmos_9855 */ { SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 1, 115200, 0, 0, netmos_serial_init },
210/* avlab_1s1p (n/t) */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, 213/* avlab_1s1p (n/t) */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
211/* avlab_1s1p_650 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, 214/* avlab_1s1p_650 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
212/* avlab_1s1p_850 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, 215/* avlab_1s1p_850 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c
index c94963145e17..6e6f42d01e64 100644
--- a/drivers/parport/probe.c
+++ b/drivers/parport/probe.c
@@ -48,14 +48,6 @@ static void pretty_print(struct parport *port, int device)
48 printk("\n"); 48 printk("\n");
49} 49}
50 50
51static char *strdup(char *str)
52{
53 int n = strlen(str)+1;
54 char *s = kmalloc(n, GFP_KERNEL);
55 if (!s) return NULL;
56 return strcpy(s, str);
57}
58
59static void parse_data(struct parport *port, int device, char *str) 51static void parse_data(struct parport *port, int device, char *str)
60{ 52{
61 char *txt = kmalloc(strlen(str)+1, GFP_KERNEL); 53 char *txt = kmalloc(strlen(str)+1, GFP_KERNEL);
@@ -88,16 +80,16 @@ static void parse_data(struct parport *port, int device, char *str)
88 if (!strcmp(p, "MFG") || !strcmp(p, "MANUFACTURER")) { 80 if (!strcmp(p, "MFG") || !strcmp(p, "MANUFACTURER")) {
89 if (info->mfr) 81 if (info->mfr)
90 kfree (info->mfr); 82 kfree (info->mfr);
91 info->mfr = strdup(sep); 83 info->mfr = kstrdup(sep, GFP_KERNEL);
92 } else if (!strcmp(p, "MDL") || !strcmp(p, "MODEL")) { 84 } else if (!strcmp(p, "MDL") || !strcmp(p, "MODEL")) {
93 if (info->model) 85 if (info->model)
94 kfree (info->model); 86 kfree (info->model);
95 info->model = strdup(sep); 87 info->model = kstrdup(sep, GFP_KERNEL);
96 } else if (!strcmp(p, "CLS") || !strcmp(p, "CLASS")) { 88 } else if (!strcmp(p, "CLS") || !strcmp(p, "CLASS")) {
97 int i; 89 int i;
98 if (info->class_name) 90 if (info->class_name)
99 kfree (info->class_name); 91 kfree (info->class_name);
100 info->class_name = strdup(sep); 92 info->class_name = kstrdup(sep, GFP_KERNEL);
101 for (u = sep; *u; u++) 93 for (u = sep; *u; u++)
102 *u = toupper(*u); 94 *u = toupper(*u);
103 for (i = 0; classes[i].token; i++) { 95 for (i = 0; classes[i].token; i++) {
@@ -112,7 +104,7 @@ static void parse_data(struct parport *port, int device, char *str)
112 !strcmp(p, "COMMAND SET")) { 104 !strcmp(p, "COMMAND SET")) {
113 if (info->cmdset) 105 if (info->cmdset)
114 kfree (info->cmdset); 106 kfree (info->cmdset);
115 info->cmdset = strdup(sep); 107 info->cmdset = kstrdup(sep, GFP_KERNEL);
116 /* if it speaks printer language, it's 108 /* if it speaks printer language, it's
117 probably a printer */ 109 probably a printer */
118 if (strstr(sep, "PJL") || strstr(sep, "PCL")) 110 if (strstr(sep, "PJL") || strstr(sep, "PCL"))
@@ -120,7 +112,7 @@ static void parse_data(struct parport *port, int device, char *str)
120 } else if (!strcmp(p, "DES") || !strcmp(p, "DESCRIPTION")) { 112 } else if (!strcmp(p, "DES") || !strcmp(p, "DESCRIPTION")) {
121 if (info->description) 113 if (info->description)
122 kfree (info->description); 114 kfree (info->description);
123 info->description = strdup(sep); 115 info->description = kstrdup(sep, GFP_KERNEL);
124 } 116 }
125 } 117 }
126 rock_on: 118 rock_on: