Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71754
b: refs/heads/master
c: 8447d9d
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent dd1f929 commit 5a716a1
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 139 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: fd9bb53942a7ca3398a63f2c238afd8fbed3ec0e
refs/heads/master: 8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d
13 changes: 7 additions & 6 deletions trunk/drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
{
ide_hwif_t *hwif;
void __iomem *base;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
if (!base)
Expand All @@ -523,9 +524,9 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)

state->hwif[0] = hwif;

probe_hwif_init(hwif);
idx[0] = hwif->index;

ide_proc_register_port(hwif);
ide_device_add(idx);

return 0;
}
Expand All @@ -537,6 +538,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
void __iomem *ioc_base, *easi_base;
unsigned int sel = 0;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
if (!ioc_base) {
Expand Down Expand Up @@ -608,11 +610,10 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
icside_dma_init(mate);
}

probe_hwif_init(hwif);
probe_hwif_init(mate);
idx[0] = hwif->index;
idx[1] = mate->index;

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;

Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/ide/arm/rapide.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
ide_hwif_t *hwif;
void __iomem *base;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

ret = ecard_request_resources(ec);
if (ret)
Expand All @@ -74,8 +75,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
hwif->hwif_data = base;
hwif->gendev.parent = &ec->dev;
hwif->noprobe = 0;
probe_hwif_init(hwif);
ide_proc_register_port(hwif);

idx[0] = hwif->index;

ide_device_add(idx);

ecard_set_drvdata(ec, hwif);
goto out;
}
Expand Down
23 changes: 20 additions & 3 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ static void probe_hwif(ide_hwif_t *hwif)
static int hwif_init(ide_hwif_t *hwif);
static void hwif_register_devices(ide_hwif_t *hwif);

int probe_hwif_init(ide_hwif_t *hwif)
static int probe_hwif_init(ide_hwif_t *hwif)
{
probe_hwif(hwif);

Expand All @@ -877,8 +877,6 @@ int probe_hwif_init(ide_hwif_t *hwif)
return 0;
}

EXPORT_SYMBOL(probe_hwif_init);

#if MAX_HWIFS > 1
/*
* save_match() is used to simplify logic in init_irq() below.
Expand Down Expand Up @@ -1410,3 +1408,22 @@ int ideprobe_init (void)
}

EXPORT_SYMBOL_GPL(ideprobe_init);

int ide_device_add(u8 idx[4])
{
int i, rc = 0;

for (i = 0; i < 4; i++) {
if (idx[i] != 0xff)
rc |= probe_hwif_init(&ide_hwifs[idx[i]]);
}

for (i = 0; i < 4; i++) {
if (idx[i] != 0xff)
ide_proc_register_port(&ide_hwifs[idx[i]]);
}

return rc;
}

EXPORT_SYMBOL_GPL(ide_device_add);
2 changes: 0 additions & 2 deletions trunk/drivers/ide/ide-proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,6 @@ void ide_proc_register_port(ide_hwif_t *hwif)
create_proc_ide_drives(hwif);
}

EXPORT_SYMBOL_GPL(ide_proc_register_port);

#ifdef CONFIG_BLK_DEV_IDEPCI
void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
{
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,10 @@ int ide_register_hw(hw_regs_t *hw, void (*fixup)(ide_hwif_t *),
hwif->chipset = hw->chipset;
hwif->gendev.parent = hw->dev;

if (!initializing) {
probe_hwif_init(hwif);
ide_proc_register_port(hwif);
if (initializing == 0) {
u8 idx[4] = { index, 0xff, 0xff, 0xff };

ide_device_add(idx);
}

if (hwifp)
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/ide/legacy/ali14xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static int __init initRegisters (void) {
static int __init ali14xx_probe(void)
{
ide_hwif_t *hwif, *mate;
static u8 idx[4] = { 0, 1, 0xff, 0xff };

printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
basePort, regOn);
Expand All @@ -217,11 +218,7 @@ static int __init ali14xx_probe(void)
mate->mate = hwif;
mate->channel = 1;

probe_hwif_init(hwif);
probe_hwif_init(mate);

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;
}
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/ide/legacy/dtc2278.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static int __init dtc2278_probe(void)
{
unsigned long flags;
ide_hwif_t *hwif, *mate;
static u8 idx[4] = { 0, 1, 0xff, 0xff };

hwif = &ide_hwifs[0];
mate = &ide_hwifs[1];
Expand Down Expand Up @@ -134,11 +135,7 @@ static int __init dtc2278_probe(void)
mate->mate = hwif;
mate->channel = 1;

probe_hwif_init(hwif);
probe_hwif_init(mate);

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;
}
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/ide/legacy/ht6560b.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
int __init ht6560b_init(void)
{
ide_hwif_t *hwif, *mate;
static u8 idx[4] = { 0, 1, 0xff, 0xff };
int t;

if (probe_ht6560b == 0)
Expand Down Expand Up @@ -359,11 +360,7 @@ int __init ht6560b_init(void)
mate->drives[0].drive_data = t;
mate->drives[1].drive_data = t;

probe_hwif_init(hwif);
probe_hwif_init(mate);

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/ide/legacy/ide_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
struct resource *res_base, *res_alt, *res_irq;
ide_hwif_t *hwif;
struct pata_platform_info *pdata;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
int ret = 0;
int mmio = 0;

Expand Down Expand Up @@ -130,10 +131,11 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
hwif->gendev.parent = &pdev->dev;
hwif->noprobe = 0;

probe_hwif_init(hwif);
idx[0] = hwif->index;

ide_device_add(idx);

platform_set_drvdata(pdev, hwif);
ide_proc_register_port(hwif);

return 0;

Expand Down
21 changes: 10 additions & 11 deletions trunk/drivers/ide/legacy/qd65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
static int __init qd_probe(int base)
{
ide_hwif_t *hwif;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
u8 config;
u8 unit;

Expand Down Expand Up @@ -419,9 +420,9 @@ static int __init qd_probe(int base)

hwif->set_pio_mode = &qd6500_set_pio_mode;

probe_hwif_init(hwif);
idx[0] = unit;

ide_proc_register_port(hwif);
ide_device_add(idx);

return 1;
}
Expand Down Expand Up @@ -453,11 +454,11 @@ static int __init qd_probe(int base)

hwif->set_pio_mode = &qd6580_set_pio_mode;

probe_hwif_init(hwif);
idx[0] = unit;

qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT);
ide_device_add(idx);

ide_proc_register_port(hwif);
qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);

return 1;
} else {
Expand All @@ -474,19 +475,17 @@ static int __init qd_probe(int base)

hwif->set_pio_mode = &qd6580_set_pio_mode;

probe_hwif_init(hwif);

qd_setup(mate, base, config | (control << 8),
QD6580_DEF_DATA2, QD6580_DEF_DATA2);

mate->set_pio_mode = &qd6580_set_pio_mode;

probe_hwif_init(mate);
idx[0] = 0;
idx[1] = 1;

qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT);
ide_device_add(idx);

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);

return 0; /* no other qd65xx possible */
}
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/ide/legacy/umc8672.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ static void umc_set_pio_mode(ide_drive_t *drive, const u8 pio)

static int __init umc8672_probe(void)
{
unsigned long flags;
ide_hwif_t *hwif, *mate;
unsigned long flags;
static u8 idx[4] = { 0, 1, 0xff, 0xff };

if (!request_region(0x108, 2, "umc8672")) {
printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n");
Expand Down Expand Up @@ -158,11 +159,7 @@ static int __init umc8672_probe(void)
mate->mate = hwif;
mate->channel = 1;

probe_hwif_init(hwif);
probe_hwif_init(mate);

ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/ide/mips/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ static int au_ide_probe(struct device *dev)
struct resource *res;
hw_regs_t *hw;
int ret = 0;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
char *mode = "MWDMA2";
Expand Down Expand Up @@ -717,9 +718,9 @@ static int au_ide_probe(struct device *dev)
dbdma_init_done = 1;
#endif

probe_hwif_init(hwif);
idx[0] = hwif->index;

ide_proc_register_port(hwif);
ide_device_add(idx);

dev_set_drvdata(dev, hwif);

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/ide/mips/swarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
u8 __iomem *base;
phys_t offset, size;
int i;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

if (!SIBYTE_HAVE_IDE)
return -ENODEV;
Expand Down Expand Up @@ -128,9 +129,9 @@ static int __devinit swarm_ide_probe(struct device *dev)
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->irq = hwif->hw.irq;

probe_hwif_init(hwif);
idx[0] = hwif->index;

ide_proc_register_port(hwif);
ide_device_add(idx);

dev_set_drvdata(dev, hwif);

Expand Down
22 changes: 3 additions & 19 deletions trunk/drivers/ide/pci/cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ static ide_pci_device_t cyrix_chipsets[] __devinitdata = {

static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_hwif_t *hwif = NULL, *mate = NULL;
ata_index_t index;
ide_pci_device_t *d = &cyrix_chipsets[id->driver_data];
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

ide_setup_pci_noise(dev, d);

Expand All @@ -172,29 +171,14 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
return -ENODEV;
}

index.all = 0xf0f0;

/*
* Now the chipset is configured we can let the core
* do all the device setup for us
*/

ide_pci_setup_ports(dev, d, 14, &index);

if ((index.b.low & 0xf0) != 0xf0)
hwif = &ide_hwifs[index.b.low];
if ((index.b.high & 0xf0) != 0xf0)
mate = &ide_hwifs[index.b.high];

if (hwif)
probe_hwif_init(hwif);
if (mate)
probe_hwif_init(mate);
ide_pci_setup_ports(dev, d, 14, &idx[0]);

if (hwif)
ide_proc_register_port(hwif);
if (mate)
ide_proc_register_port(mate);
ide_device_add(idx);

return 0;
}
Expand Down
Loading

0 comments on commit 5a716a1

Please sign in to comment.