Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354231
b: refs/heads/master
c: cdcc022
h: refs/heads/master
i:
  354229: f8102bc
  354227: d8b2ae8
  354223: d46686d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 30, 2013
1 parent 34322bb commit 5a41f03
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86be5680f5804690654519751ed77aaa54b01826
refs/heads/master: cdcc02291bea28b85b81230cb9bd328ab7a3cb35
53 changes: 21 additions & 32 deletions trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,41 +944,12 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data)
return pcmcia_request_io(p_dev);
}

static void daqp_cs_config(struct pcmcia_device *link)
{
int ret;

dev_dbg(&link->dev, "daqp_cs_config\n");

link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;

ret = pcmcia_loop_config(link, daqp_pcmcia_config_loop, NULL);
if (ret) {
dev_warn(&link->dev, "no configuration found\n");
goto failed;
}

ret = pcmcia_request_irq(link, daqp_interrupt);
if (ret)
goto failed;

ret = pcmcia_enable_device(link);
if (ret)
goto failed;

return;

failed:
pcmcia_disable_device(link);
}

static int daqp_cs_attach(struct pcmcia_device *link)
{
struct local_info_t *local;
int ret;
int i;

dev_dbg(&link->dev, "daqp_cs_attach()\n");

for (i = 0; i < MAX_DEV; i++)
if (dev_table[i] == NULL)
break;
Expand All @@ -988,7 +959,7 @@ static int daqp_cs_attach(struct pcmcia_device *link)
}

/* Allocate space for private device-specific data */
local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
local = kzalloc(sizeof(*local), GFP_KERNEL);
if (!local)
return -ENOMEM;

Expand All @@ -997,9 +968,27 @@ static int daqp_cs_attach(struct pcmcia_device *link)
local->link = link;
link->priv = local;

daqp_cs_config(link);
link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;

ret = pcmcia_loop_config(link, daqp_pcmcia_config_loop, NULL);
if (ret) {
dev_warn(&link->dev, "no configuration found\n");
goto failed;
}

ret = pcmcia_request_irq(link, daqp_interrupt);
if (ret)
goto failed;

ret = pcmcia_enable_device(link);
if (ret)
goto failed;

return 0;

failed:
pcmcia_disable_device(link);
return ret;
}

static void daqp_cs_detach(struct pcmcia_device *link)
Expand Down

0 comments on commit 5a41f03

Please sign in to comment.