[parisc-linux-cvs] register_pa_dev -> register_parisc_device
Ryan Bradetich
rbradetich@uswest.net
Mon, 17 Sep 2001 19:12:57 -0600
--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
This patch is a small cleanup to convert the register_pa_dev
function to register_parisc_device.
- Ryan
--
--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dev.patch"
Index: Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/Makefile,v
retrieving revision 1.133
diff -u -p -r1.133 Makefile
--- Makefile 2001/09/17 22:13:50 1.133
+++ Makefile 2001/09/18 01:07:25
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 9
-EXTRAVERSION = -pa21
+EXTRAVERSION = -pa22
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
Index: arch/parisc/kernel/drivers.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/drivers.c,v
retrieving revision 1.23
diff -u -p -r1.23 drivers.c
--- drivers.c 2001/09/03 18:08:36 1.23
+++ drivers.c 2001/09/18 01:07:26
@@ -253,15 +253,21 @@ struct parisc_device *alloc_pa_dev(unsig
return dev;
}
-/* Return status if device is managed */
-int register_pa_dev(struct parisc_device *hp_dev)
+/**
+ * register_parisc_device - Locate a driver to manage this device.
+ * @dev: The parisc device.
+ *
+ * Search the driver list for a driver that is willing to manage
+ * this device.
+ */
+int register_parisc_device(struct parisc_device *dev)
{
struct parisc_driver *driver;
- if (!hp_dev)
+ if (!dev)
return 0;
- if (hp_dev->driver)
+ if (dev->driver)
return 1;
write_lock(&pa_lock);
@@ -270,9 +276,9 @@ int register_pa_dev(struct parisc_device
/* Locate a driver which agrees to manage this device. */
while (driver) {
- if (match_device(driver,hp_dev)) {
- if (driver->probe(hp_dev) == 0) {
- hp_dev->driver = driver;
+ if (match_device(driver, dev)) {
+ if (driver->probe(dev) == 0) {
+ dev->driver = driver;
write_unlock(&pa_lock);
return 1;
}
Index: arch/parisc/kernel/inventory.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v
retrieving revision 1.33
diff -u -p -r1.33 inventory.c
--- inventory.c 2001/08/30 16:48:58 1.33
+++ inventory.c 2001/09/18 01:07:27
@@ -202,7 +202,7 @@ static int pat_query_module(ulong pcell_
dev->pmod_loc = pa_pdc_cell.mod_location;
dev->mod_path = pa_pdc_cell.mod_path;
- register_pa_dev(dev); /* advertise device */
+ register_parisc_device(dev); /* advertise device */
#ifdef DEBUG_PAT
/* dump what we see so far... */
@@ -408,17 +408,17 @@ static void do_system_map_memconfig(void
static struct parisc_device *legacy_create_device(struct pdc_memory_map *r_addr,
struct pdc_module_path *module_path)
{
- struct parisc_device *hp_dev;
+ struct parisc_device *dev;
int status = pdc_mem_map_hpa(r_addr, module_path);
if (status != PDC_RET_OK)
return NULL;
- hp_dev = alloc_pa_dev(r_addr->hpa);
- if (hp_dev == NULL)
+ dev = alloc_pa_dev(r_addr->hpa);
+ if (dev == NULL)
return NULL;
- register_pa_dev(hp_dev);
- return hp_dev;
+ register_parisc_device(dev);
+ return dev;
}
/**
@@ -488,11 +488,11 @@ int do_native_bus_walk(unsigned long hpa
hpa + (MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET);
for (; hpa < hpa_end; hpa += NATIVE_DEVICE_OFFSET) {
- struct parisc_device *hp_device = alloc_pa_dev(hpa);
- if (!hp_device)
+ struct parisc_device *dev = alloc_pa_dev(hpa);
+ if (!dev)
continue;
- register_pa_dev(hp_device);
+ register_parisc_device(dev);
++num;
}
return num;
@@ -502,7 +502,7 @@ static int do_system_map_inventory(void)
{
int i, j, num;
long status;
- struct parisc_device *hp_device;
+ struct parisc_device *dev;
struct pdc_system_map_mod_info module_result;
struct pdc_system_map_addr_info addr_result;
struct pdc_module_path module_path;
@@ -521,11 +521,11 @@ static int do_system_map_inventory(void)
if (status != PDC_RET_OK)
continue;
- hp_device = alloc_pa_dev((unsigned long) module_result.mod_addr);
- if (!hp_device)
+ dev = alloc_pa_dev((unsigned long) module_result.mod_addr);
+ if (!dev)
continue;
- register_pa_dev(hp_device);
+ register_parisc_device(dev);
++num;
/* if available, get the additional addresses for a module */
@@ -535,7 +535,7 @@ static int do_system_map_inventory(void)
for (j = 1; j <= module_result.add_addrs; ++j) {
status = pdc_system_map_find_addrs(&addr_result, i, j);
if (status == PDC_RET_OK) {
- add_pa_dev_addr(hp_device, (unsigned long)
+ add_pa_dev_addr(dev, (unsigned long)
addr_result.mod_addr);
} else {
printk(KERN_WARNING
Index: include/asm-parisc/hardware.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/hardware.h,v
retrieving revision 1.20
diff -u -p -r1.20 hardware.h
--- hardware.h 2001/08/28 07:49:49 1.20
+++ hardware.h 2001/09/18 01:07:31
@@ -99,7 +99,7 @@ extern enum cpu_type parisc_get_cpu_type
/* drivers.c: */
extern struct parisc_device *alloc_pa_dev(unsigned long hpa);
-extern int register_pa_dev(struct parisc_device *dev);
+extern int register_parisc_device(struct parisc_device *dev);
extern int add_pa_dev_addr(struct parisc_device *dev, unsigned long addr);
extern int get_num_pa_dev(void);
extern void print_pa_devices(int start_index, int num_indexes);
--Kj7319i9nmIyA2yE--