diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-24 09:54:14 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-09 02:30:03 -0500 |
commit | 3e7166178a83fef690dcbfcdaeda192f7282a9a4 (patch) | |
tree | 3bf45f6d67858964d303e6848ef1cd326625d2b7 /drivers/scsi/pcmcia/fdomain_stub.c | |
parent | 2caff14713d53abba273e6095495788e2720f756 (diff) |
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
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-scsi@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 06254f46a0dd..5792b55c9d3c 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -59,16 +59,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); | |||
59 | MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); | 59 | MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); |
60 | MODULE_LICENSE("Dual MPL/GPL"); | 60 | MODULE_LICENSE("Dual MPL/GPL"); |
61 | 61 | ||
62 | #ifdef PCMCIA_DEBUG | ||
63 | static int pc_debug = PCMCIA_DEBUG; | ||
64 | module_param(pc_debug, int, 0); | ||
65 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
66 | static char *version = | ||
67 | "fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)"; | ||
68 | #else | ||
69 | #define DEBUG(n, args...) | ||
70 | #endif | ||
71 | |||
72 | /*====================================================================*/ | 62 | /*====================================================================*/ |
73 | 63 | ||
74 | typedef struct scsi_info_t { | 64 | typedef struct scsi_info_t { |
@@ -86,7 +76,7 @@ static int fdomain_probe(struct pcmcia_device *link) | |||
86 | { | 76 | { |
87 | scsi_info_t *info; | 77 | scsi_info_t *info; |
88 | 78 | ||
89 | DEBUG(0, "fdomain_attach()\n"); | 79 | dev_dbg(&link->dev, "fdomain_attach()\n"); |
90 | 80 | ||
91 | /* Create new SCSI device */ | 81 | /* Create new SCSI device */ |
92 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 82 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -111,7 +101,7 @@ static int fdomain_probe(struct pcmcia_device *link) | |||
111 | 101 | ||
112 | static void fdomain_detach(struct pcmcia_device *link) | 102 | static void fdomain_detach(struct pcmcia_device *link) |
113 | { | 103 | { |
114 | DEBUG(0, "fdomain_detach(0x%p)\n", link); | 104 | dev_dbg(&link->dev, "fdomain_detach\n"); |
115 | 105 | ||
116 | fdomain_release(link); | 106 | fdomain_release(link); |
117 | 107 | ||
@@ -120,9 +110,6 @@ static void fdomain_detach(struct pcmcia_device *link) | |||
120 | 110 | ||
121 | /*====================================================================*/ | 111 | /*====================================================================*/ |
122 | 112 | ||
123 | #define CS_CHECK(fn, ret) \ | ||
124 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
125 | |||
126 | static int fdomain_config_check(struct pcmcia_device *p_dev, | 113 | static int fdomain_config_check(struct pcmcia_device *p_dev, |
127 | cistpl_cftable_entry_t *cfg, | 114 | cistpl_cftable_entry_t *cfg, |
128 | cistpl_cftable_entry_t *dflt, | 115 | cistpl_cftable_entry_t *dflt, |
@@ -137,20 +124,22 @@ static int fdomain_config_check(struct pcmcia_device *p_dev, | |||
137 | static int fdomain_config(struct pcmcia_device *link) | 124 | static int fdomain_config(struct pcmcia_device *link) |
138 | { | 125 | { |
139 | scsi_info_t *info = link->priv; | 126 | scsi_info_t *info = link->priv; |
140 | int last_ret, last_fn; | 127 | int ret; |
141 | char str[22]; | 128 | char str[22]; |
142 | struct Scsi_Host *host; | 129 | struct Scsi_Host *host; |
143 | 130 | ||
144 | DEBUG(0, "fdomain_config(0x%p)\n", link); | 131 | dev_dbg(&link->dev, "fdomain_config\n"); |
145 | 132 | ||
146 | last_ret = pcmcia_loop_config(link, fdomain_config_check, NULL); | 133 | ret = pcmcia_loop_config(link, fdomain_config_check, NULL); |
147 | if (last_ret) { | 134 | if (ret) |
148 | cs_error(link, RequestIO, last_ret); | ||
149 | goto failed; | 135 | goto failed; |
150 | } | ||
151 | 136 | ||
152 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 137 | ret = pcmcia_request_irq(link, &link->irq); |
153 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 138 | if (ret) |
139 | goto failed; | ||
140 | ret = pcmcia_request_configuration(link, &link->conf); | ||
141 | if (ret) | ||
142 | goto failed; | ||
154 | 143 | ||
155 | /* A bad hack... */ | 144 | /* A bad hack... */ |
156 | release_region(link->io.BasePort1, link->io.NumPorts1); | 145 | release_region(link->io.BasePort1, link->io.NumPorts1); |
@@ -162,11 +151,11 @@ static int fdomain_config(struct pcmcia_device *link) | |||
162 | host = __fdomain_16x0_detect(&fdomain_driver_template); | 151 | host = __fdomain_16x0_detect(&fdomain_driver_template); |
163 | if (!host) { | 152 | if (!host) { |
164 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); | 153 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); |
165 | goto cs_failed; | 154 | goto failed; |
166 | } | 155 | } |
167 | 156 | ||
168 | if (scsi_add_host(host, NULL)) | 157 | if (scsi_add_host(host, NULL)) |
169 | goto cs_failed; | 158 | goto failed; |
170 | scsi_scan_host(host); | 159 | scsi_scan_host(host); |
171 | 160 | ||
172 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 161 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
@@ -175,8 +164,6 @@ static int fdomain_config(struct pcmcia_device *link) | |||
175 | 164 | ||
176 | return 0; | 165 | return 0; |
177 | 166 | ||
178 | cs_failed: | ||
179 | cs_error(link, last_fn, last_ret); | ||
180 | failed: | 167 | failed: |
181 | fdomain_release(link); | 168 | fdomain_release(link); |
182 | return -ENODEV; | 169 | return -ENODEV; |
@@ -188,7 +175,7 @@ static void fdomain_release(struct pcmcia_device *link) | |||
188 | { | 175 | { |
189 | scsi_info_t *info = link->priv; | 176 | scsi_info_t *info = link->priv; |
190 | 177 | ||
191 | DEBUG(0, "fdomain_release(0x%p)\n", link); | 178 | dev_dbg(&link->dev, "fdomain_release\n"); |
192 | 179 | ||
193 | scsi_remove_host(info->host); | 180 | scsi_remove_host(info->host); |
194 | pcmcia_disable_device(link); | 181 | pcmcia_disable_device(link); |