Commit 01b2726d authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] Rename get_property to of_get_property: partial drivers

This does drivers/machintosh and the hvc code.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a48141db
...@@ -575,7 +575,7 @@ static int hvc_find_vtys(void) ...@@ -575,7 +575,7 @@ static int hvc_find_vtys(void)
(num_found >= VTTY_PORTS)) (num_found >= VTTY_PORTS))
break; break;
vtermno = get_property(vty, "reg", NULL); vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno) if (!vtermno)
continue; continue;
......
...@@ -153,7 +153,7 @@ static int hvc_find_vtys(void) ...@@ -153,7 +153,7 @@ static int hvc_find_vtys(void)
if (num_found >= MAX_NR_HVC_CONSOLES) if (num_found >= MAX_NR_HVC_CONSOLES)
break; break;
vtermno = get_property(vty, "reg", NULL); vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno) if (!vtermno)
continue; continue;
......
...@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void) ...@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void)
struct hvsi_struct *hp; struct hvsi_struct *hp;
const uint32_t *vtermno, *irq; const uint32_t *vtermno, *irq;
vtermno = get_property(vty, "reg", NULL); vtermno = of_get_property(vty, "reg", NULL);
irq = get_property(vty, "interrupts", NULL); irq = of_get_property(vty, "interrupts", NULL);
if (!vtermno || !irq) if (!vtermno || !irq)
continue; continue;
......
...@@ -395,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -395,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
#endif #endif
MAX_NODE_NAME_SIZE, np->name); MAX_NODE_NAME_SIZE, np->name);
} else { } else {
reg = get_property(np, "reg", NULL); reg = of_get_property(np, "reg", NULL);
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index, chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
......
...@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf) ...@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
int length = 0; int length = 0;
of = &to_macio_device (dev)->ofdev; of = &to_macio_device (dev)->ofdev;
compat = get_property(of->node, "compatible", &cplen); compat = of_get_property(of->node, "compatible", &cplen);
if (!compat) { if (!compat) {
*buf = '\0'; *buf = '\0';
return 0; return 0;
...@@ -47,7 +47,7 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, ...@@ -47,7 +47,7 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
int length; int length;
of = &to_macio_device (dev)->ofdev; of = &to_macio_device (dev)->ofdev;
compat = get_property(of->node, "compatible", &cplen); compat = of_get_property(of->node, "compatible", &cplen);
if (!compat) compat = "", cplen = 1; if (!compat) compat = "", cplen = 1;
length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type);
buf += length; buf += length;
......
...@@ -387,7 +387,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev, ...@@ -387,7 +387,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
if (strcmp(np->name, "lightshow") == 0) if (strcmp(np->name, "lightshow") == 0)
break; break;
if ((strcmp(np->name, "sound") == 0) && if ((strcmp(np->name, "sound") == 0) &&
get_property(np, "virtual", NULL) != NULL) of_get_property(np, "virtual", NULL) != NULL)
break; break;
} }
if (np == NULL) { if (np == NULL) {
......
...@@ -491,7 +491,7 @@ int __init smu_init (void) ...@@ -491,7 +491,7 @@ int __init smu_init (void)
printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
goto fail; goto fail;
} }
data = get_property(smu->db_node, "reg", NULL); data = of_get_property(smu->db_node, "reg", NULL);
if (data == NULL) { if (data == NULL) {
of_node_put(smu->db_node); of_node_put(smu->db_node);
smu->db_node = NULL; smu->db_node = NULL;
...@@ -512,7 +512,7 @@ int __init smu_init (void) ...@@ -512,7 +512,7 @@ int __init smu_init (void)
smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt"); smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
if (smu->msg_node == NULL) if (smu->msg_node == NULL)
break; break;
data = get_property(smu->msg_node, "reg", NULL); data = of_get_property(smu->msg_node, "reg", NULL);
if (data == NULL) { if (data == NULL) {
of_node_put(smu->msg_node); of_node_put(smu->msg_node);
smu->msg_node = NULL; smu->msg_node = NULL;
...@@ -1004,7 +1004,7 @@ const struct smu_sdbp_header *__smu_get_sdb_partition(int id, ...@@ -1004,7 +1004,7 @@ const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
} else } else
mutex_lock(&smu_part_access); mutex_lock(&smu_part_access);
part = get_property(smu->of_node, pname, size); part = of_get_property(smu->of_node, pname, size);
if (part == NULL) { if (part == NULL) {
DPRINTK("trying to extract from SMU ...\n"); DPRINTK("trying to extract from SMU ...\n");
part = smu_create_sdb_partition(id); part = smu_create_sdb_partition(id);
......
...@@ -567,13 +567,13 @@ thermostat_init(void) ...@@ -567,13 +567,13 @@ thermostat_init(void)
else else
return -ENODEV; return -ENODEV;
prop = get_property(np, "hwsensor-params-version", NULL); prop = of_get_property(np, "hwsensor-params-version", NULL);
printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop,
(*prop == 1)?"":"un"); (*prop == 1)?"":"un");
if (*prop != 1) if (*prop != 1)
return -ENODEV; return -ENODEV;
prop = get_property(np, "reg", NULL); prop = of_get_property(np, "reg", NULL);
if (!prop) if (!prop)
return -ENODEV; return -ENODEV;
...@@ -591,9 +591,9 @@ thermostat_init(void) ...@@ -591,9 +591,9 @@ thermostat_init(void)
"limit_adjust: %d, fan_speed: %d\n", "limit_adjust: %d, fan_speed: %d\n",
therm_bus, therm_address, limit_adjust, fan_speed); therm_bus, therm_address, limit_adjust, fan_speed);
if (get_property(np, "hwsensor-location", NULL)) { if (of_get_property(np, "hwsensor-location", NULL)) {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
sensor_location[i] = get_property(np, sensor_location[i] = of_get_property(np,
"hwsensor-location", NULL) + offset; "hwsensor-location", NULL) + offset;
if (sensor_location[i] == NULL) if (sensor_location[i] == NULL)
......
...@@ -674,7 +674,7 @@ static int read_eeprom(int cpu, struct mpu_data *out) ...@@ -674,7 +674,7 @@ static int read_eeprom(int cpu, struct mpu_data *out)
printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n"); printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n");
return -ENODEV; return -ENODEV;
} }
data = get_property(np, "cpuid", &len); data = of_get_property(np, "cpuid", &len);
if (data == NULL) { if (data == NULL) {
printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n"); printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n");
of_node_put(np); of_node_put(np);
...@@ -1337,7 +1337,7 @@ static int init_backside_state(struct backside_pid_state *state) ...@@ -1337,7 +1337,7 @@ static int init_backside_state(struct backside_pid_state *state)
*/ */
u3 = of_find_node_by_path("/u3@0,f8000000"); u3 = of_find_node_by_path("/u3@0,f8000000");
if (u3 != NULL) { if (u3 != NULL) {
const u32 *vers = get_property(u3, "device-rev", NULL); const u32 *vers = of_get_property(u3, "device-rev", NULL);
if (vers) if (vers)
if (((*vers) & 0x3f) < 0x34) if (((*vers) & 0x3f) < 0x34)
u3h = 0; u3h = 0;
...@@ -2129,8 +2129,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node) ...@@ -2129,8 +2129,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
continue; continue;
/* Lookup for a matching location */ /* Lookup for a matching location */
loc = get_property(np, "location", NULL); loc = of_get_property(np, "location", NULL);
reg = get_property(np, "reg", NULL); reg = of_get_property(np, "reg", NULL);
if (loc == NULL || reg == NULL) if (loc == NULL || reg == NULL)
continue; continue;
DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg); DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg);
......
...@@ -492,7 +492,7 @@ g4fan_init( void ) ...@@ -492,7 +492,7 @@ g4fan_init( void )
if( !(np=of_find_node_by_name(NULL, "power-mgt")) ) if( !(np=of_find_node_by_name(NULL, "power-mgt")) )
return -ENODEV; return -ENODEV;
info = get_property(np, "thermal-info", NULL); info = of_get_property(np, "thermal-info", NULL);
of_node_put(np); of_node_put(np);
if( !info || !machine_is_compatible("PowerMac3,6") ) if( !info || !machine_is_compatible("PowerMac3,6") )
......
...@@ -131,7 +131,7 @@ int __init find_via_cuda(void) ...@@ -131,7 +131,7 @@ int __init find_via_cuda(void)
if (vias == 0) if (vias == 0)
return 0; return 0;
reg = get_property(vias, "reg", NULL); reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) { if (reg == NULL) {
printk(KERN_ERR "via-cuda: No \"reg\" property !\n"); printk(KERN_ERR "via-cuda: No \"reg\" property !\n");
goto fail; goto fail;
......
...@@ -118,7 +118,7 @@ static int __init via_pmu_led_init(void) ...@@ -118,7 +118,7 @@ static int __init via_pmu_led_init(void)
dt = of_find_node_by_path("/"); dt = of_find_node_by_path("/");
if (dt == NULL) if (dt == NULL)
return -ENODEV; return -ENODEV;
model = get_property(dt, "model", NULL); model = of_get_property(dt, "model", NULL);
if (model == NULL) if (model == NULL)
return -ENODEV; return -ENODEV;
if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 && if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
......
...@@ -289,7 +289,7 @@ int __init find_via_pmu(void) ...@@ -289,7 +289,7 @@ int __init find_via_pmu(void)
if (vias == NULL) if (vias == NULL)
return 0; return 0;
reg = get_property(vias, "reg", NULL); reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) { if (reg == NULL) {
printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); printk(KERN_ERR "via-pmu: No \"reg\" property !\n");
goto fail; goto fail;
...@@ -334,7 +334,7 @@ int __init find_via_pmu(void) ...@@ -334,7 +334,7 @@ int __init find_via_pmu(void)
gpiop = of_find_node_by_name(NULL, "gpio"); gpiop = of_find_node_by_name(NULL, "gpio");
if (gpiop) { if (gpiop) {
reg = get_property(gpiop, "reg", NULL); reg = of_get_property(gpiop, "reg", NULL);
if (reg) if (reg)
gaddr = of_translate_address(gpiop, reg); gaddr = of_translate_address(gpiop, reg);
if (gaddr != OF_BAD_ADDR) if (gaddr != OF_BAD_ADDR)
...@@ -491,7 +491,7 @@ static int __init via_pmu_dev_init(void) ...@@ -491,7 +491,7 @@ static int __init via_pmu_dev_init(void)
of_find_node_by_name(NULL, "power-mgt"); of_find_node_by_name(NULL, "power-mgt");
const u32 *prim_info = NULL; const u32 *prim_info = NULL;
if (prim) if (prim)
prim_info = get_property(prim, "prim-info", NULL); prim_info = of_get_property(prim, "prim-info", NULL);
if (prim_info) { if (prim_info) {
/* Other stuffs here yet unknown */ /* Other stuffs here yet unknown */
pmu_battery_count = (prim_info[6] >> 16) & 0xff; pmu_battery_count = (prim_info[6] >> 16) & 0xff;
......
...@@ -176,7 +176,7 @@ static int wf_lm75_attach(struct i2c_adapter *adapter) ...@@ -176,7 +176,7 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
for (dev = NULL; for (dev = NULL;
(dev = of_get_next_child(busnode, dev)) != NULL;) { (dev = of_get_next_child(busnode, dev)) != NULL;) {
const char *loc = const char *loc =
get_property(dev, "hwsensor-location", NULL); of_get_property(dev, "hwsensor-location", NULL);
u8 addr; u8 addr;
/* We must re-match the adapter in order to properly check /* We must re-match the adapter in order to properly check
......
...@@ -134,7 +134,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) ...@@ -134,7 +134,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
if (!device_is_compatible(dev, "max6690")) if (!device_is_compatible(dev, "max6690"))
continue; continue;
addr = pmac_i2c_get_dev_addr(dev); addr = pmac_i2c_get_dev_addr(dev);
loc = get_property(dev, "hwsensor-location", NULL); loc = of_get_property(dev, "hwsensor-location", NULL);
if (loc == NULL || addr == 0) if (loc == NULL || addr == 0)
continue; continue;
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
......
...@@ -167,7 +167,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, ...@@ -167,7 +167,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
if (fct == NULL) if (fct == NULL)
return NULL; return NULL;
fct->ctrl.ops = &smu_fan_ops; fct->ctrl.ops = &smu_fan_ops;
l = get_property(node, "location", NULL); l = of_get_property(node, "location", NULL);
if (l == NULL) if (l == NULL)
goto fail; goto fail;
...@@ -224,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, ...@@ -224,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
goto fail; goto fail;
/* Get min & max values*/ /* Get min & max values*/
v = get_property(node, "min-value", NULL); v = of_get_property(node, "min-value", NULL);
if (v == NULL) if (v == NULL)
goto fail; goto fail;
fct->min = *v; fct->min = *v;
v = get_property(node, "max-value", NULL); v = of_get_property(node, "max-value", NULL);
if (v == NULL) if (v == NULL)
goto fail; goto fail;
fct->max = *v; fct->max = *v;
/* Get "reg" value */ /* Get "reg" value */
reg = get_property(node, "reg", NULL); reg = of_get_property(node, "reg", NULL);
if (reg == NULL) if (reg == NULL)
goto fail; goto fail;
fct->reg = *reg; fct->reg = *reg;
......
...@@ -241,7 +241,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) ...@@ -241,7 +241,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
char *name; char *name;
int vsens[2], isens[2]; int vsens[2], isens[2];
reg = get_property(dev, "reg", NULL); reg = of_get_property(dev, "reg", NULL);
if (reg == NULL) if (reg == NULL)
return; return;
addr = *reg; addr = *reg;
...@@ -268,9 +268,9 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) ...@@ -268,9 +268,9 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
isens[0] = isens[1] = -1; isens[0] = isens[1] = -1;
child = NULL; child = NULL;
while ((child = of_get_next_child(dev, child)) != NULL) { while ((child = of_get_next_child(dev, child)) != NULL) {
reg = get_property(child, "reg", NULL); reg = of_get_property(child, "reg", NULL);
type = get_property(child, "device_type", NULL); type = of_get_property(child, "device_type", NULL);
loc = get_property(child, "location", NULL); loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL) if (reg == NULL || loc == NULL)
continue; continue;
......
...@@ -204,8 +204,8 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) ...@@ -204,8 +204,8 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node)
ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL); ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL);
if (ads == NULL) if (ads == NULL)
return NULL; return NULL;
c = get_property(node, "device_type", NULL); c = of_get_property(node, "device_type", NULL);
l = get_property(node, "location", NULL); l = of_get_property(node, "location", NULL);
if (c == NULL || l == NULL) if (c == NULL || l == NULL)
goto fail; goto fail;
...@@ -255,7 +255,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) ...@@ -255,7 +255,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node)
} else } else
goto fail; goto fail;
v = get_property(node, "reg", NULL); v = of_get_property(node, "reg", NULL);
if (v == NULL) if (v == NULL)
goto fail; goto fail;
ads->reg = *v; ads->reg = *v;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment