aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia/pdaudiocf
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-24 09:55:12 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:05 -0500
commit7c5af6ffd69bb2bb3c86b374153627529d67598c (patch)
treebadcdc8b07e8542d8eb2f9f6e8965a488c5f5e75 /sound/pcmcia/pdaudiocf
parent9ec0bf41b5030ccc691049754ed1398cad5e953e (diff)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
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: Jaroslav Kysela <perex@perex.cz> CC: alsa-devel@alsa-project.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'sound/pcmcia/pdaudiocf')
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 7dea74b71cf1..64b859925c0b 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link)
217 * configuration callback 217 * configuration callback
218 */ 218 */
219 219
220#define CS_CHECK(fn, ret) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223static int pdacf_config(struct pcmcia_device *link) 220static int pdacf_config(struct pcmcia_device *link)
224{ 221{
225 struct snd_pdacf *pdacf = link->priv; 222 struct snd_pdacf *pdacf = link->priv;
226 int last_fn, last_ret; 223 int ret;
227 224
228 snd_printdd(KERN_DEBUG "pdacf_config called\n"); 225 snd_printdd(KERN_DEBUG "pdacf_config called\n");
229 link->conf.ConfigIndex = 0x5; 226 link->conf.ConfigIndex = 0x5;
230 227
231 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 228 ret = pcmcia_request_io(link, &link->io);
232 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 229 if (ret)
233 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 230 goto failed;
231
232 ret = pcmcia_request_irq(link, &link->irq);
233 if (ret)
234 goto failed;
235
236 ret = pcmcia_request_configuration(link, &link->conf);
237 if (ret)
238 goto failed;
234 239
235 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 240 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
236 goto failed; 241 goto failed;
@@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link)
238 link->dev_node = &pdacf->node; 243 link->dev_node = &pdacf->node;
239 return 0; 244 return 0;
240 245
241cs_failed:
242 cs_error(link, last_fn, last_ret);
243failed: 246failed:
244 pcmcia_disable_device(link); 247 pcmcia_disable_device(link);
245 return -ENODEV; 248 return -ENODEV;