of/sparc: convert various prom_* functions to use phandle
Rather than passing around ints everywhere, use the phandle type where appropriate for the various functions that talk to the PROM. Signed-off-by: Andres Salomon <dilinger@queued.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:

committed by
Grant Likely

parent
4e13efc991
commit
8d1255627d
@@ -23,7 +23,7 @@ static DEFINE_SPINLOCK(auxio_lock);
|
||||
|
||||
void __init auxio_probe(void)
|
||||
{
|
||||
int node, auxio_nd;
|
||||
phandle node, auxio_nd;
|
||||
struct linux_prom_registers auxregs[1];
|
||||
struct resource r;
|
||||
|
||||
@@ -113,7 +113,7 @@ volatile unsigned char * auxio_power_register = NULL;
|
||||
void __init auxio_power_probe(void)
|
||||
{
|
||||
struct linux_prom_registers regs;
|
||||
int node;
|
||||
phandle node;
|
||||
struct resource r;
|
||||
|
||||
/* Attempt to find the sun4m power control node. */
|
||||
|
@@ -40,7 +40,7 @@ static unsigned char *dispDeviceBase __force_data;
|
||||
|
||||
static unsigned char vga_font[cmapsz];
|
||||
|
||||
static int __init btext_initialize(unsigned int node)
|
||||
static int __init btext_initialize(phandle node)
|
||||
{
|
||||
unsigned int width, height, depth, pitch;
|
||||
unsigned long address = 0;
|
||||
@@ -309,7 +309,7 @@ static struct console btext_console = {
|
||||
|
||||
int __init btext_find_display(void)
|
||||
{
|
||||
unsigned int node;
|
||||
phandle node;
|
||||
char type[32];
|
||||
int ret;
|
||||
|
||||
|
@@ -31,9 +31,9 @@ static char *cpu_mid_prop(void)
|
||||
return "mid";
|
||||
}
|
||||
|
||||
static int check_cpu_node(int nd, int *cur_inst,
|
||||
int (*compare)(int, int, void *), void *compare_arg,
|
||||
int *prom_node, int *mid)
|
||||
static int check_cpu_node(phandle nd, int *cur_inst,
|
||||
int (*compare)(phandle, int, void *), void *compare_arg,
|
||||
phandle *prom_node, int *mid)
|
||||
{
|
||||
if (!compare(nd, *cur_inst, compare_arg)) {
|
||||
if (prom_node)
|
||||
@@ -51,8 +51,8 @@ static int check_cpu_node(int nd, int *cur_inst,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
|
||||
int *prom_node, int *mid)
|
||||
static int __cpu_find_by(int (*compare)(phandle, int, void *),
|
||||
void *compare_arg, phandle *prom_node, int *mid)
|
||||
{
|
||||
struct device_node *dp;
|
||||
int cur_inst;
|
||||
@@ -71,7 +71,7 @@ static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int cpu_instance_compare(int nd, int instance, void *_arg)
|
||||
static int cpu_instance_compare(phandle nd, int instance, void *_arg)
|
||||
{
|
||||
int desired_instance = (int) _arg;
|
||||
|
||||
@@ -80,13 +80,13 @@ static int cpu_instance_compare(int nd, int instance, void *_arg)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int cpu_find_by_instance(int instance, int *prom_node, int *mid)
|
||||
int cpu_find_by_instance(int instance, phandle *prom_node, int *mid)
|
||||
{
|
||||
return __cpu_find_by(cpu_instance_compare, (void *)instance,
|
||||
prom_node, mid);
|
||||
}
|
||||
|
||||
static int cpu_mid_compare(int nd, int instance, void *_arg)
|
||||
static int cpu_mid_compare(phandle nd, int instance, void *_arg)
|
||||
{
|
||||
int desired_mid = (int) _arg;
|
||||
int this_mid;
|
||||
@@ -98,7 +98,7 @@ static int cpu_mid_compare(int nd, int instance, void *_arg)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int cpu_find_by_mid(int mid, int *prom_node)
|
||||
int cpu_find_by_mid(int mid, phandle *prom_node)
|
||||
{
|
||||
return __cpu_find_by(cpu_mid_compare, (void *)mid,
|
||||
prom_node, NULL);
|
||||
@@ -108,7 +108,7 @@ int cpu_find_by_mid(int mid, int *prom_node)
|
||||
* address (0-3). This gives us the true hardware mid, which might have
|
||||
* some other bits set. On 4d hardware and software mids are the same.
|
||||
*/
|
||||
int cpu_get_hwmid(int prom_node)
|
||||
int cpu_get_hwmid(phandle prom_node)
|
||||
{
|
||||
return prom_getintdefault(prom_node, cpu_mid_prop(), -ENODEV);
|
||||
}
|
||||
@@ -119,7 +119,8 @@ void __init device_scan(void)
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
{
|
||||
int err, cpu_node;
|
||||
phandle cpu_node;
|
||||
int err;
|
||||
err = cpu_find_by_instance(0, &cpu_node, NULL);
|
||||
if (err) {
|
||||
/* Probably a sun4e, Sun is trying to trick us ;-) */
|
||||
|
@@ -284,7 +284,7 @@ int __init pcic_probe(void)
|
||||
struct linux_prom_registers regs[PROMREG_MAX];
|
||||
struct linux_pbm_info* pbm;
|
||||
char namebuf[64];
|
||||
int node;
|
||||
phandle node;
|
||||
int err;
|
||||
|
||||
if (pcic0_up) {
|
||||
@@ -440,7 +440,7 @@ static int __devinit pdev_to_pnode(struct linux_pbm_info *pbm,
|
||||
{
|
||||
struct linux_prom_pci_registers regs[PROMREG_MAX];
|
||||
int err;
|
||||
int node = prom_getchild(pbm->prom_node);
|
||||
phandle node = prom_getchild(pbm->prom_node);
|
||||
|
||||
while(node) {
|
||||
err = prom_getproperty(node, "reg",
|
||||
|
@@ -315,7 +315,7 @@ void __init setup_arch(char **cmdline_p)
|
||||
|
||||
#ifdef CONFIG_IP_PNP
|
||||
if (!ic_set_manually) {
|
||||
int chosen = prom_finddevice ("/chosen");
|
||||
phandle chosen = prom_finddevice("/chosen");
|
||||
u32 cl, sv, gw;
|
||||
|
||||
cl = prom_getintdefault (chosen, "client-ip", 0);
|
||||
|
@@ -23,7 +23,7 @@ int this_is_starfire = 0;
|
||||
|
||||
void check_if_starfire(void)
|
||||
{
|
||||
int ssnode = prom_finddevice("/ssp-serial");
|
||||
phandle ssnode = prom_finddevice("/ssp-serial");
|
||||
if (ssnode != 0 && ssnode != -1)
|
||||
this_is_starfire = 1;
|
||||
}
|
||||
|
@@ -100,7 +100,7 @@ static void swift_clockstop(void)
|
||||
|
||||
void __init clock_stop_probe(void)
|
||||
{
|
||||
unsigned int node, clk_nd;
|
||||
phandle node, clk_nd;
|
||||
char name[20];
|
||||
|
||||
prom_getstring(prom_root_node, "name", name, sizeof(name));
|
||||
|
Reference in New Issue
Block a user