git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ide/ide-cs: fix order of releasing resources
[safe/jmp/linux-2.6]
/
drivers
/
ide
/
icside.c
diff --git
a/drivers/ide/icside.c
b/drivers/ide/icside.c
index
bdfeb12
..
d7e6f09
100644
(file)
--- a/
drivers/ide/icside.c
+++ b/
drivers/ide/icside.c
@@
-236,7
+236,8
@@
static const struct ide_port_ops icside_v6_no_dma_port_ops = {
*/
static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
{
*/
static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
{
- int cycle_time, use_dma_info = 0;
+ unsigned long cycle_time;
+ int use_dma_info = 0;
switch (xfer_mode) {
case XFER_MW_DMA_2:
switch (xfer_mode) {
case XFER_MW_DMA_2:
@@
-267,10
+268,11
@@
static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time)
cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME];
if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time)
cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME];
-
drive->drive_data = cycle_time
;
+
ide_set_drivedata(drive, (void *)cycle_time)
;
printk("%s: %s selected (peak %dMB/s)\n", drive->name,
printk("%s: %s selected (peak %dMB/s)\n", drive->name,
- ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
+ ide_xfer_verbose(xfer_mode),
+ 2000 / (unsigned long)ide_get_drivedata(drive));
}
static const struct ide_port_ops icside_v6_port_ops = {
}
static const struct ide_port_ops icside_v6_port_ops = {
@@
-287,13
+289,8
@@
static int icside_dma_end(ide_drive_t *drive)
ide_hwif_t *hwif = drive->hwif;
struct expansion_card *ec = ECARD_DEV(hwif->dev);
ide_hwif_t *hwif = drive->hwif;
struct expansion_card *ec = ECARD_DEV(hwif->dev);
- drive->waiting_for_dma = 0;
-
disable_dma(ec->dma);
disable_dma(ec->dma);
- /* Teardown mappings after DMA has completed. */
- ide_destroy_dmatable(drive);
-
return get_dma_residue(ec->dma) != 0;
}
return get_dma_residue(ec->dma) != 0;
}
@@
-307,15
+304,14
@@
static void icside_dma_start(ide_drive_t *drive)
enable_dma(ec->dma);
}
enable_dma(ec->dma);
}
-static int icside_dma_setup(ide_drive_t *drive)
+static int icside_dma_setup(ide_drive_t *drive
, struct ide_cmd *cmd
)
{
ide_hwif_t *hwif = drive->hwif;
struct expansion_card *ec = ECARD_DEV(hwif->dev);
struct icside_state *state = ecard_get_drvdata(ec);
{
ide_hwif_t *hwif = drive->hwif;
struct expansion_card *ec = ECARD_DEV(hwif->dev);
struct icside_state *state = ecard_get_drvdata(ec);
- struct request *rq = hwif->rq;
unsigned int dma_mode;
unsigned int dma_mode;
- if (
rq_data_dir(rq)
)
+ if (
cmd->tf_flags & IDE_TFLAG_WRITE
)
dma_mode = DMA_MODE_WRITE;
else
dma_mode = DMA_MODE_READ;
dma_mode = DMA_MODE_WRITE;
else
dma_mode = DMA_MODE_READ;
@@
-338,26
+334,18
@@
static int icside_dma_setup(ide_drive_t *drive)
/*
* Select the correct timing for this drive.
*/
/*
* Select the correct timing for this drive.
*/
- set_dma_speed(ec->dma,
drive->drive_data
);
+ set_dma_speed(ec->dma,
(unsigned long)ide_get_drivedata(drive)
);
/*
* Tell the DMA engine about the SG table and
* data direction.
*/
/*
* Tell the DMA engine about the SG table and
* data direction.
*/
- set_dma_sg(ec->dma, hwif->sg_table,
hwif->cmd.
sg_nents);
+ set_dma_sg(ec->dma, hwif->sg_table,
cmd->
sg_nents);
set_dma_mode(ec->dma, dma_mode);
set_dma_mode(ec->dma, dma_mode);
- drive->waiting_for_dma = 1;
-
return 0;
}
return 0;
}
-static void icside_dma_exec_cmd(ide_drive_t *drive, u8 cmd)
-{
- /* issue cmd to drive */
- ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD, NULL);
-}
-
static int icside_dma_test_irq(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
static int icside_dma_test_irq(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
@@
-381,11
+369,9
@@
static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
static const struct ide_dma_ops icside_v6_dma_ops = {
.dma_host_set = icside_dma_host_set,
.dma_setup = icside_dma_setup,
static const struct ide_dma_ops icside_v6_dma_ops = {
.dma_host_set = icside_dma_host_set,
.dma_setup = icside_dma_setup,
- .dma_exec_cmd = icside_dma_exec_cmd,
.dma_start = icside_dma_start,
.dma_end = icside_dma_end,
.dma_test_irq = icside_dma_test_irq,
.dma_start = icside_dma_start,
.dma_end = icside_dma_end,
.dma_test_irq = icside_dma_test_irq,
- .dma_timeout = ide_dma_timeout,
.dma_lost_irq = ide_dma_lost_irq,
};
#else
.dma_lost_irq = ide_dma_lost_irq,
};
#else
@@
-397,7
+383,7
@@
static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d)
return -EOPNOTSUPP;
}
return -EOPNOTSUPP;
}
-static void icside_setup_ports(
hw_regs_t
*hw, void __iomem *base,
+static void icside_setup_ports(
struct ide_hw
*hw, void __iomem *base,
struct cardinfo *info, struct expansion_card *ec)
{
unsigned long port = (unsigned long)base + info->dataoffset;
struct cardinfo *info, struct expansion_card *ec)
{
unsigned long port = (unsigned long)base + info->dataoffset;
@@
-414,11
+400,11
@@
static void icside_setup_ports(hw_regs_t *hw, void __iomem *base,
hw->irq = ec->irq;
hw->dev = &ec->dev;
hw->irq = ec->irq;
hw->dev = &ec->dev;
- hw->chipset = ide_acorn;
}
static const struct ide_port_info icside_v5_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
}
static const struct ide_port_info icside_v5_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
+ .chipset = ide_acorn,
};
static int __devinit
};
static int __devinit
@@
-426,7
+412,7
@@
icside_register_v5(struct icside_state *state, struct expansion_card *ec)
{
void __iomem *base;
struct ide_host *host;
{
void __iomem *base;
struct ide_host *host;
-
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL
};
+
struct ide_hw hw, *hws[] = { &hw
};
int ret;
base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
int ret;
base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
@@
-447,7
+433,7
@@
icside_register_v5(struct icside_state *state, struct expansion_card *ec)
icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec);
icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec);
- host = ide_host_alloc(&icside_v5_port_info, hws);
+ host = ide_host_alloc(&icside_v5_port_info, hws
, 1
);
if (host == NULL)
return -ENODEV;
if (host == NULL)
return -ENODEV;
@@
-473,6
+459,7
@@
static const struct ide_port_info icside_v6_port_info __initdata = {
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
.mwdma_mask = ATA_MWDMA2,
.swdma_mask = ATA_SWDMA2,
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
.mwdma_mask = ATA_MWDMA2,
.swdma_mask = ATA_SWDMA2,
+ .chipset = ide_acorn,
};
static int __devinit
};
static int __devinit
@@
-482,7
+469,7
@@
icside_register_v6(struct icside_state *state, struct expansion_card *ec)
struct ide_host *host;
unsigned int sel = 0;
int ret;
struct ide_host *host;
unsigned int sel = 0;
int ret;
-
hw_regs_t hw[2], *hws[] = { &hw[0], NULL, NULL, NULL
};
+
struct ide_hw hw[2], *hws[] = { &hw[0], &hw[1]
};
struct ide_port_info d = icside_v6_port_info;
ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
struct ide_port_info d = icside_v6_port_info;
ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
@@
-522,7
+509,7
@@
icside_register_v6(struct icside_state *state, struct expansion_card *ec)
icside_setup_ports(&hw[0], easi_base, &icside_cardinfo_v6_1, ec);
icside_setup_ports(&hw[1], easi_base, &icside_cardinfo_v6_2, ec);
icside_setup_ports(&hw[0], easi_base, &icside_cardinfo_v6_1, ec);
icside_setup_ports(&hw[1], easi_base, &icside_cardinfo_v6_2, ec);
- host = ide_host_alloc(&d, hws);
+ host = ide_host_alloc(&d, hws
, 2
);
if (host == NULL)
return -ENODEV;
if (host == NULL)
return -ENODEV;