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

Commit 5cbf79cd authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: add ide_proc_register_port()



* create_proc_ide_interfaces() tries to add /proc entries for every probed
  and initialized IDE port, replace it by ide_proc_register_port() which does
  it only for the given port (also rename destroy_proc_ide_interface() to
  ide_proc_unregister_port() for consistency)
  
* convert {create,destroy}_proc_ide_interface[s]() users to use new functions

* pmac driver depended on proc_ide_create() to add /proc port entries, fix it
  
* au1xxx-ide, swarm and cs5520 drivers depended indirectly on ide-generic
  driver (CONFIG_IDE_GENERIC=y) to add port /proc entries, fix them

* there is now no need to add /proc entries for IDE ports in proc_ide_create()
  so don't do it

* proc_ide_create() needs now to be called before drivers are probed - fix it,
  while at it make proc_ide_create() create /proc "ide" directory

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 869c56ee
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -591,7 +591,8 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
	state->hwif[0] = hwif;

	probe_hwif_init(hwif);
	create_proc_ide_interfaces();

	ide_proc_register_port(hwif);

	return 0;
}
@@ -679,7 +680,9 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)

	probe_hwif_init(hwif);
	probe_hwif_init(mate);
	create_proc_ide_interfaces();

	ide_proc_register_port(hwif);
	ide_proc_register_port(mate);

	return 0;

+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
		hwif->gendev.parent = &ec->dev;
		hwif->noprobe = 0;
		probe_hwif_init(hwif);
		create_proc_ide_interfaces();
		ide_proc_register_port(hwif);
		ecard_set_drvdata(ec, hwif);
		goto out;
	}
+0 −2
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ static int __init ide_generic_init(void)
	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
		ide_release_lock();	/* for atari only */

	create_proc_ide_interfaces();

	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -1427,6 +1427,9 @@ int ideprobe_init (void)
				}
		}
	}
	for (index = 0; index < MAX_HWIFS; ++index)
		if (probe[index])
			ide_proc_register_port(&ide_hwifs[index]);
	return 0;
}

+17 −17
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@

#include <asm/io.h>

static struct proc_dir_entry *proc_ide_root;

static int proc_ide_read_imodel
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
@@ -783,26 +785,24 @@ static ide_proc_entry_t hwif_entries[] = {
	{ NULL,	0, NULL, NULL }
};

void create_proc_ide_interfaces(void)
void ide_proc_register_port(ide_hwif_t *hwif)
{
	int	h;

	for (h = 0; h < MAX_HWIFS; h++) {
		ide_hwif_t *hwif = &ide_hwifs[h];

	if (!hwif->present)
			continue;
		return;

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

		if (!hwif->proc)
			return;

		ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
	}

	create_proc_ide_drives(hwif);
}
}

EXPORT_SYMBOL(create_proc_ide_interfaces);
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)
@@ -813,7 +813,7 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
#endif

void destroy_proc_ide_interface(ide_hwif_t *hwif)
void ide_proc_unregister_port(ide_hwif_t *hwif)
{
	if (hwif->proc) {
		destroy_proc_ide_drives(hwif);
@@ -860,11 +860,11 @@ void proc_ide_create(void)
{
	struct proc_dir_entry *entry;

	proc_ide_root = proc_mkdir("ide", NULL);

	if (!proc_ide_root)
		return;

	create_proc_ide_interfaces();

	entry = create_proc_entry("drivers", 0, proc_ide_root);
	if (entry)
		entry->proc_fops = &ide_drivers_operations;
Loading