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

Commit 327617e1 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: move hwif->present check out from ide_proc_register_port()



Move hwif->present check out from ide_proc_register_port() to
ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent eafd88a3
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -1448,8 +1448,13 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
	}
	}


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

		hwif = &ide_hwifs[idx[i]];

		if (hwif->present)
			ide_proc_register_port(hwif);
	}
	}


	return rc;
	return rc;
+0 −3
Original line number Original line Diff line number Diff line
@@ -793,9 +793,6 @@ static ide_proc_entry_t hwif_entries[] = {


void ide_proc_register_port(ide_hwif_t *hwif)
void ide_proc_register_port(ide_hwif_t *hwif)
{
{
	if (!hwif->present)
		return;

	if (!hwif->proc) {
	if (!hwif->proc) {
		hwif->proc = proc_mkdir(hwif->name, proc_ide_root);
		hwif->proc = proc_mkdir(hwif->name, proc_ide_root);