Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169107
b: refs/heads/master
c: 444486a
h: refs/heads/master
i:
  169105: cf35a49
  169103: bbaa8fb
v: v3
  • Loading branch information
Dominik Brodowski committed Nov 8, 2009
1 parent 59afadc commit bc7a015
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 30 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: 6d9a299f675b176e2f81e1f6d5a361a1173971ea
refs/heads/master: 444486a5f9d2737b50e53dc140292899b9497808
16 changes: 8 additions & 8 deletions trunk/drivers/ata/pata_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ static struct ata_port_operations pcmcia_8bit_port_ops = {
.drain_fifo = pcmcia_8bit_drain_fifo,
};

#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)


struct pcmcia_config_check {
unsigned long ctl_base;
Expand Down Expand Up @@ -252,7 +249,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
struct ata_port *ap;
struct ata_pcmcia_info *info;
struct pcmcia_config_check *stk = NULL;
int last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM, p;
int is_kme = 0, ret = -ENOMEM, p;
unsigned long io_base, ctl_base;
void __iomem *io_addr, *ctl_addr;
int n_ports = 1;
Expand Down Expand Up @@ -296,8 +293,13 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
}
io_base = pdev->io.BasePort1;
ctl_base = stk->ctl_base;
CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &pdev->irq));
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &pdev->conf));
ret = pcmcia_request_irq(pdev, &pdev->irq);
if (ret)
goto failed;

ret = pcmcia_request_configuration(pdev, &pdev->conf);
if (ret)
goto failed;

/* iomap */
ret = -ENOMEM;
Expand Down Expand Up @@ -351,8 +353,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
kfree(stk);
return 0;

cs_failed:
cs_error(pdev, last_fn, last_ret);
failed:
kfree(stk);
info->ndev = 0;
Expand Down
32 changes: 11 additions & 21 deletions trunk/drivers/ide/ide-cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
MODULE_DESCRIPTION("PCMCIA ATA/IDE card driver");
MODULE_LICENSE("Dual MPL/GPL");

#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)

#ifdef CONFIG_PCMCIA_DEBUG
INT_MODULE_PARM(pc_debug, 0);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
#else
#define DEBUG(n, args...)
#endif

/*====================================================================*/

typedef struct ide_info_t {
Expand Down Expand Up @@ -98,7 +89,7 @@ static int ide_probe(struct pcmcia_device *link)
{
ide_info_t *info;

DEBUG(0, "ide_attach()\n");
dev_dbg(&link->dev, "ide_attach()\n");

/* Create new ide device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
Expand Down Expand Up @@ -134,7 +125,7 @@ static void ide_detach(struct pcmcia_device *link)
ide_hwif_t *hwif = info->host->ports[0];
unsigned long data_addr, ctl_addr;

DEBUG(0, "ide_detach(0x%p)\n", link);
dev_dbg(&link->dev, "ide_detach(0x%p)\n", link);

data_addr = hwif->io_ports.data_addr;
ctl_addr = hwif->io_ports.ctl_addr;
Expand Down Expand Up @@ -217,9 +208,6 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
======================================================================*/

#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)

struct pcmcia_config_check {
unsigned long ctl_base;
int skip_vcc;
Expand Down Expand Up @@ -282,11 +270,11 @@ static int ide_config(struct pcmcia_device *link)
{
ide_info_t *info = link->priv;
struct pcmcia_config_check *stk = NULL;
int last_ret = 0, last_fn = 0, is_kme = 0;
int ret = 0, is_kme = 0;
unsigned long io_base, ctl_base;
struct ide_host *host;

DEBUG(0, "ide_config(0x%p)\n", link);
dev_dbg(&link->dev, "ide_config(0x%p)\n", link);

is_kme = ((link->manf_id == MANFID_KME) &&
((link->card_id == PRODID_KME_KXLC005_A) ||
Expand All @@ -306,8 +294,12 @@ static int ide_config(struct pcmcia_device *link)
io_base = link->io.BasePort1;
ctl_base = stk->ctl_base;

CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
ret = pcmcia_request_irq(link, &link->irq);
if (ret)
goto failed;
ret = pcmcia_request_configuration(link, &link->conf);
if (ret)
goto failed;

/* disable drive interrupts during IDE probe */
outb(0x02, ctl_base);
Expand Down Expand Up @@ -342,8 +334,6 @@ static int ide_config(struct pcmcia_device *link)
printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
goto failed;

cs_failed:
cs_error(link, last_fn, last_ret);
failed:
kfree(stk);
ide_release(link);
Expand All @@ -363,7 +353,7 @@ static void ide_release(struct pcmcia_device *link)
ide_info_t *info = link->priv;
struct ide_host *host = info->host;

DEBUG(0, "ide_release(0x%p)\n", link);
dev_dbg(&link->dev, "ide_release(0x%p)\n", link);

if (info->ndev)
/* FIXME: if this fails we need to queue the cleanup somehow
Expand Down

0 comments on commit bc7a015

Please sign in to comment.