Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dca39830 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: pass number of ports to ide_host_{alloc,add}() (v2)



Pass number of ports to ide_host_{alloc,add}() and then update
all users accordingly.

v2:
- drop no longer needed NULL initializers in buddha.c, cmd640.c and gayle.c
  (noticed by Sergei)

There should be no functional changes caused by this patch.

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 29e52cf7
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -247,8 +247,7 @@ irqreturn_t at91_irq_handler(int irq, void *dev_id)
static int __init at91_ide_probe(struct platform_device *pdev)
{
	int ret;
	hw_regs_t hw;
	hw_regs_t *hws[] = { &hw, NULL, NULL, NULL };
	hw_regs_t hw, *hws[] = { &hw };
	struct ide_host *host;
	struct resource *res;
	unsigned long tf_base = 0, ctl_base = 0;
@@ -307,7 +306,7 @@ static int __init at91_ide_probe(struct platform_device *pdev)
	hw.irq = board->irq_pin;
	hw.dev = &pdev->dev;

	host = ide_host_alloc(&at91_ide_port_info, hws);
	host = ide_host_alloc(&at91_ide_port_info, hws, 1);
	if (!host) {
		perr("failed to allocate ide host\n");
		return -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ static int au_ide_probe(struct platform_device *dev)
	struct resource *res;
	struct ide_host *host;
	int ret = 0;
	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
	hw_regs_t hw, *hws[] = { &hw };

#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
	char *mode = "MWDMA2";
@@ -550,7 +550,7 @@ static int au_ide_probe(struct platform_device *dev)
	hw.irq = ahwif->irq;
	hw.dev = &dev->dev;

	ret = ide_host_add(&au1xxx_port_info, hws, &host);
	ret = ide_host_add(&au1xxx_port_info, hws, 1, &host);
	if (ret)
		goto out;

+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static int __init buddha_init(void)

	while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
		unsigned long board;
		hw_regs_t hw[MAX_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
		hw_regs_t hw[MAX_NUM_HWIFS], *hws[MAX_NUM_HWIFS];

		if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
			buddha_num_hwifs = BUDDHA_NUM_HWIFS;
@@ -224,7 +224,7 @@ static int __init buddha_init(void)
			hws[i] = &hw[i];
		}

		ide_host_add(&buddha_port_info, hws, NULL);
		ide_host_add(&buddha_port_info, hws, i, NULL);
	}

	return 0;
+3 −2
Original line number Diff line number Diff line
@@ -708,7 +708,7 @@ static int __init cmd640x_init(void)
	int second_port_cmd640 = 0, rc;
	const char *bus_type, *port2;
	u8 b, cfr;
	hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
	hw_regs_t hw[2], *hws[2];

	if (cmd640_vlb && probe_for_cmd640_vlb()) {
		bus_type = "VLB";
@@ -822,7 +822,8 @@ static int __init cmd640x_init(void)
	cmd640_dump_regs();
#endif

	return ide_host_add(&cmd640_port_info, hws, NULL);
	return ide_host_add(&cmd640_port_info, hws, second_port_cmd640 ? 2 : 1,
			    NULL);
}

module_param_named(probe_vlb, cmd640_vlb, bool, 0);
+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static const struct ide_port_info cyrix_chipset __devinitdata = {
static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
	const struct ide_port_info *d = &cyrix_chipset;
	hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
	hw_regs_t hw[2], *hws[] = { NULL, NULL };

	ide_setup_pci_noise(dev, d);

@@ -136,7 +136,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
	ide_pci_setup_ports(dev, d, &hw[0], &hws[0]);
	hw[0].irq = 14;

	return ide_host_add(d, hws, NULL);
	return ide_host_add(d, hws, 2, NULL);
}

static const struct pci_device_id cs5520_pci_tbl[] = {
Loading