diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-24 09:55:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-09 02:30:05 -0500 |
commit | 9b44de2015ff4a2ed1d56efedfcc72b917d356a6 (patch) | |
tree | 63460e0cf95d4bbea0111d153247c3298ac4ff3d /drivers/telephony | |
parent | 7c5af6ffd69bb2bb3c86b374153627529d67598c (diff) |
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.
CC: linux-mtd@lists.infradead.org
CC: linux-usb@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/telephony')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index 347c3ed1d9f1..d442fd35620a 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -19,13 +19,6 @@ | |||
19 | * PCMCIA service support for Quicknet cards | 19 | * PCMCIA service support for Quicknet cards |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifdef PCMCIA_DEBUG | ||
23 | static int pc_debug = PCMCIA_DEBUG; | ||
24 | module_param(pc_debug, int, 0644); | ||
25 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
26 | #else | ||
27 | #define DEBUG(n, args...) | ||
28 | #endif | ||
29 | 22 | ||
30 | typedef struct ixj_info_t { | 23 | typedef struct ixj_info_t { |
31 | int ndev; | 24 | int ndev; |
@@ -39,7 +32,7 @@ static void ixj_cs_release(struct pcmcia_device * link); | |||
39 | 32 | ||
40 | static int ixj_probe(struct pcmcia_device *p_dev) | 33 | static int ixj_probe(struct pcmcia_device *p_dev) |
41 | { | 34 | { |
42 | DEBUG(0, "ixj_attach()\n"); | 35 | dev_dbg(&p_dev->dev, "ixj_attach()\n"); |
43 | /* Create new ixj device */ | 36 | /* Create new ixj device */ |
44 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 37 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
45 | p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 38 | p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; |
@@ -55,33 +48,30 @@ static int ixj_probe(struct pcmcia_device *p_dev) | |||
55 | 48 | ||
56 | static void ixj_detach(struct pcmcia_device *link) | 49 | static void ixj_detach(struct pcmcia_device *link) |
57 | { | 50 | { |
58 | DEBUG(0, "ixj_detach(0x%p)\n", link); | 51 | dev_dbg(&link->dev, "ixj_detach\n"); |
59 | 52 | ||
60 | ixj_cs_release(link); | 53 | ixj_cs_release(link); |
61 | 54 | ||
62 | kfree(link->priv); | 55 | kfree(link->priv); |
63 | } | 56 | } |
64 | 57 | ||
65 | #define CS_CHECK(fn, ret) \ | ||
66 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
67 | |||
68 | static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | 58 | static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) |
69 | { | 59 | { |
70 | char *str; | 60 | char *str; |
71 | int i, place; | 61 | int i, place; |
72 | DEBUG(0, "ixj_get_serial(0x%p)\n", link); | 62 | dev_dbg(&link->dev, "ixj_get_serial\n"); |
73 | 63 | ||
74 | str = link->prod_id[0]; | 64 | str = link->prod_id[0]; |
75 | if (!str) | 65 | if (!str) |
76 | goto cs_failed; | 66 | goto failed; |
77 | printk("%s", str); | 67 | printk("%s", str); |
78 | str = link->prod_id[1]; | 68 | str = link->prod_id[1]; |
79 | if (!str) | 69 | if (!str) |
80 | goto cs_failed; | 70 | goto failed; |
81 | printk(" %s", str); | 71 | printk(" %s", str); |
82 | str = link->prod_id[2]; | 72 | str = link->prod_id[2]; |
83 | if (!str) | 73 | if (!str) |
84 | goto cs_failed; | 74 | goto failed; |
85 | place = 1; | 75 | place = 1; |
86 | for (i = strlen(str) - 1; i >= 0; i--) { | 76 | for (i = strlen(str) - 1; i >= 0; i--) { |
87 | switch (str[i]) { | 77 | switch (str[i]) { |
@@ -118,9 +108,9 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | |||
118 | } | 108 | } |
119 | str = link->prod_id[3]; | 109 | str = link->prod_id[3]; |
120 | if (!str) | 110 | if (!str) |
121 | goto cs_failed; | 111 | goto failed; |
122 | printk(" version %s\n", str); | 112 | printk(" version %s\n", str); |
123 | cs_failed: | 113 | failed: |
124 | return; | 114 | return; |
125 | } | 115 | } |
126 | 116 | ||
@@ -151,13 +141,13 @@ static int ixj_config(struct pcmcia_device * link) | |||
151 | cistpl_cftable_entry_t dflt = { 0 }; | 141 | cistpl_cftable_entry_t dflt = { 0 }; |
152 | 142 | ||
153 | info = link->priv; | 143 | info = link->priv; |
154 | DEBUG(0, "ixj_config(0x%p)\n", link); | 144 | dev_dbg(&link->dev, "ixj_config\n"); |
155 | 145 | ||
156 | if (pcmcia_loop_config(link, ixj_config_check, &dflt)) | 146 | if (pcmcia_loop_config(link, ixj_config_check, &dflt)) |
157 | goto cs_failed; | 147 | goto failed; |
158 | 148 | ||
159 | if (pcmcia_request_configuration(link, &link->conf)) | 149 | if (pcmcia_request_configuration(link, &link->conf)) |
160 | goto cs_failed; | 150 | goto failed; |
161 | 151 | ||
162 | /* | 152 | /* |
163 | * Register the card with the core. | 153 | * Register the card with the core. |
@@ -170,7 +160,7 @@ static int ixj_config(struct pcmcia_device * link) | |||
170 | ixj_get_serial(link, j); | 160 | ixj_get_serial(link, j); |
171 | return 0; | 161 | return 0; |
172 | 162 | ||
173 | cs_failed: | 163 | failed: |
174 | ixj_cs_release(link); | 164 | ixj_cs_release(link); |
175 | return -ENODEV; | 165 | return -ENODEV; |
176 | } | 166 | } |
@@ -178,7 +168,7 @@ static int ixj_config(struct pcmcia_device * link) | |||
178 | static void ixj_cs_release(struct pcmcia_device *link) | 168 | static void ixj_cs_release(struct pcmcia_device *link) |
179 | { | 169 | { |
180 | ixj_info_t *info = link->priv; | 170 | ixj_info_t *info = link->priv; |
181 | DEBUG(0, "ixj_cs_release(0x%p)\n", link); | 171 | dev_dbg(&link->dev, "ixj_cs_release\n"); |
182 | info->ndev = 0; | 172 | info->ndev = 0; |
183 | pcmcia_disable_device(link); | 173 | pcmcia_disable_device(link); |
184 | } | 174 | } |