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

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

ide-generic: use ide_find_port() (take 3)



There should be no functional changes caused by this patch.

v2:
* Fix comment (noticed by Sergei Shtylyov).

v3:
* Fix no initalization of idx in some case. (Johann Felix Soden)

Cc: Johann Felix Soden <johfel@users.sourceforge.net>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent e277f91f
Loading
Loading
Loading
Loading
+12 −2
Original line number Original line Diff line number Diff line
@@ -90,11 +90,21 @@ static int __init ide_generic_init(void)
	int i;
	int i;


	for (i = 0; i < MAX_HWIFS; i++) {
	for (i = 0; i < MAX_HWIFS; i++) {
		ide_hwif_t *hwif = &ide_hwifs[i];
		ide_hwif_t *hwif;
		unsigned long io_addr = ide_default_io_base(i);
		unsigned long io_addr = ide_default_io_base(i);
		hw_regs_t hw;
		hw_regs_t hw;


		if (hwif->chipset == ide_unknown && io_addr) {
		if (io_addr) {
			/*
			 * Skip probing if the corresponding
			 * slot is already occupied.
			 */
			hwif = ide_find_port();
			if (hwif == NULL || hwif->index != i) {
				idx[i] = 0xff;
				continue;
			}

			memset(&hw, 0, sizeof(hw));
			memset(&hw, 0, sizeof(hw));
			ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
			ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
			hw.irq = ide_default_irq(io_addr);
			hw.irq = ide_default_irq(io_addr);