mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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>
This commit is contained in:
parent
9ec0bf41b5
commit
7c5af6ffd6
@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link)
|
||||
* configuration callback
|
||||
*/
|
||||
|
||||
#define CS_CHECK(fn, ret) \
|
||||
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
|
||||
|
||||
static int pdacf_config(struct pcmcia_device *link)
|
||||
{
|
||||
struct snd_pdacf *pdacf = link->priv;
|
||||
int last_fn, last_ret;
|
||||
int ret;
|
||||
|
||||
snd_printdd(KERN_DEBUG "pdacf_config called\n");
|
||||
link->conf.ConfigIndex = 0x5;
|
||||
|
||||
CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
|
||||
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
|
||||
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
|
||||
ret = pcmcia_request_io(link, &link->io);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_request_irq(link, &link->irq);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_request_configuration(link, &link->conf);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
|
||||
goto failed;
|
||||
@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link)
|
||||
link->dev_node = &pdacf->node;
|
||||
return 0;
|
||||
|
||||
cs_failed:
|
||||
cs_error(link, last_fn, last_ret);
|
||||
failed:
|
||||
pcmcia_disable_device(link);
|
||||
return -ENODEV;
|
||||
|
@ -213,14 +213,11 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
|
||||
* configuration callback
|
||||
*/
|
||||
|
||||
#define CS_CHECK(fn, ret) \
|
||||
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
|
||||
|
||||
static int vxpocket_config(struct pcmcia_device *link)
|
||||
{
|
||||
struct vx_core *chip = link->priv;
|
||||
struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
|
||||
int last_fn, last_ret;
|
||||
int ret;
|
||||
|
||||
snd_printdd(KERN_DEBUG "vxpocket_config called\n");
|
||||
|
||||
@ -235,9 +232,17 @@ static int vxpocket_config(struct pcmcia_device *link)
|
||||
strcpy(chip->card->driver, vxp440_hw.name);
|
||||
}
|
||||
|
||||
CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
|
||||
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
|
||||
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
|
||||
ret = pcmcia_request_io(link, &link->io);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_request_irq(link, &link->irq);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
ret = pcmcia_request_configuration(link, &link->conf);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
chip->dev = &handle_to_dev(link);
|
||||
snd_card_set_dev(chip->card, chip->dev);
|
||||
@ -248,8 +253,6 @@ static int vxpocket_config(struct pcmcia_device *link)
|
||||
link->dev_node = &vxp->node;
|
||||
return 0;
|
||||
|
||||
cs_failed:
|
||||
cs_error(link, last_fn, last_ret);
|
||||
failed:
|
||||
pcmcia_disable_device(link);
|
||||
return -ENODEV;
|
||||
|
Loading…
Reference in New Issue
Block a user