* [PATCH 1/6] [POWERPC] get_property returns const
@ 2007-04-03 0:52 Stephen Rothwell
2007-04-03 0:54 ` [PATCH 2/6] [POWERPC] Rename get_property to of_get_property Stephen Rothwell
2007-04-27 4:32 ` [PATCH] Partialially revert a7edd0e676d51145ae634a2acf7a447e319200fa Stephen Rothwell
0 siblings, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:52 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This just tidies up some of the remains.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/hwmon/ams/ams-core.c | 4 ++--
drivers/hwmon/ams/ams-i2c.c | 4 ++--
drivers/hwmon/ams/ams-pmu.c | 4 ++--
drivers/infiniband/hw/ehca/ehca_main.c | 4 ++--
drivers/net/ehea/ehea_main.c | 8 ++++----
drivers/scsi/ibmvscsi/ibmvstgt.c | 4 ++--
drivers/video/aty/radeon_pm.c | 2 +-
sound/aoa/codecs/snd-aoa-codec-onyx.c | 4 ++--
sound/aoa/codecs/snd-aoa-codec-tas.c | 7 ++++---
sound/aoa/core/snd-aoa-gpio-feature.c | 6 +++---
sound/aoa/fabrics/snd-aoa-fabric-layout.c | 4 ++--
sound/aoa/soundbus/core.c | 9 ++++-----
sound/aoa/soundbus/i2sbus/i2sbus-core.c | 7 +++----
sound/oss/dmasound/dmasound_awacs.c | 20 ++++++++++----------
sound/oss/dmasound/tas_common.c | 4 ++--
15 files changed, 45 insertions(+), 46 deletions(-)
Compiled an allmodconfig with this.
I am pretty sure that none of the following patches depends on this one.
Dave, just cc'ing you on this set of patches to let you know what
direction we are heading in.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
index f1f0f5d..f5ebad5 100644
--- a/drivers/hwmon/ams/ams-core.c
+++ b/drivers/hwmon/ams/ams-core.c
@@ -141,10 +141,10 @@ static void ams_worker(struct work_struct *work)
int ams_sensor_attach(void)
{
int result;
- u32 *prop;
+ const u32 *prop;
/* Get orientation */
- prop = (u32*)get_property(ams_info.of_node, "orientation", NULL);
+ prop = get_property(ams_info.of_node, "orientation", NULL);
if (!prop)
return -ENODEV;
ams_info.orient1 = *prop;
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
index 0d24bdf..485d333 100644
--- a/drivers/hwmon/ams/ams-i2c.c
+++ b/drivers/hwmon/ams/ams-i2c.c
@@ -263,7 +263,7 @@ int __init ams_i2c_init(struct device_node *np)
{
char *tmp_bus;
int result;
- u32 *prop;
+ const u32 *prop;
mutex_lock(&ams_info.lock);
@@ -276,7 +276,7 @@ int __init ams_i2c_init(struct device_node *np)
ams_info.bustype = BUS_I2C;
/* look for bus either using "reg" or by path */
- prop = (u32*)get_property(ams_info.of_node, "reg", NULL);
+ prop = get_property(ams_info.of_node, "reg", NULL);
if (!prop) {
result = -ENODEV;
diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
index 4636ae0..1b01c21 100644
--- a/drivers/hwmon/ams/ams-pmu.c
+++ b/drivers/hwmon/ams/ams-pmu.c
@@ -146,7 +146,7 @@ static void ams_pmu_exit(void)
int __init ams_pmu_init(struct device_node *np)
{
- u32 *prop;
+ const u32 *prop;
int result;
mutex_lock(&ams_info.lock);
@@ -160,7 +160,7 @@ int __init ams_pmu_init(struct device_node *np)
ams_info.bustype = BUS_HOST;
/* Get PMU command, should be 0x4e, but we can never know */
- prop = (u32*)get_property(ams_info.of_node, "reg", NULL);
+ prop = get_property(ams_info.of_node, "reg", NULL);
if (!prop) {
result = -ENODEV;
goto exit;
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 059da96..cee66b7 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -565,11 +565,11 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev,
const struct of_device_id *id)
{
struct ehca_shca *shca;
- u64 *handle;
+ const u64 *handle;
struct ib_pd *ibpd;
int ret;
- handle = (u64 *)get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
+ handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
if (!handle) {
ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
dev->ofdev.node->full_name);
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 0e4042b..d1a8134 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2320,7 +2320,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
struct net_device *dev = port->netdev;
struct ehea_adapter *adapter = port->adapter;
struct hcp_ehea_port_cb4 *cb4;
- u32 *dn_log_port_id;
+ const u32 *dn_log_port_id;
int jumbo = 0;
sema_init(&port->port_lock, 1);
@@ -2336,7 +2336,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
port->of_dev_node = dn;
/* Determine logical port id */
- dn_log_port_id = (u32*)get_property(dn, "ibm,hea-port-no", NULL);
+ dn_log_port_id = get_property(dn, "ibm,hea-port-no", NULL);
if (!dn_log_port_id) {
ehea_error("bad device node: dn_log_port_id=%p",
@@ -2492,7 +2492,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
const struct of_device_id *id)
{
struct ehea_adapter *adapter;
- u64 *adapter_handle;
+ const u64 *adapter_handle;
int ret;
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
@@ -2502,7 +2502,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
goto out;
}
- adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
+ adapter_handle = get_property(dev->ofdev.node, "ibm,hea-handle",
NULL);
if (adapter_handle)
adapter->handle = *adapter_handle;
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index 4368ca0..f65f21d 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -897,7 +897,7 @@ static int get_system_info(void)
{
struct device_node *rootdn;
const char *id, *model, *name;
- unsigned int *num;
+ const unsigned int *num;
rootdn = find_path_device("/");
if (!rootdn)
@@ -912,7 +912,7 @@ static int get_system_info(void)
if (name)
strncpy(partition_name, name, sizeof(partition_name));
- num = (unsigned int *) get_property(rootdn, "ibm,partition-no", NULL);
+ num = get_property(rootdn, "ibm,partition-no", NULL);
if (num)
partition_number = *num;
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index 9a2b0d6..c411293 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -1262,7 +1262,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
/* This is the code for the Aluminium PowerBooks M10 / iBooks M11 */
if (rinfo->family == CHIP_FAMILY_RV350) {
u32 sdram_mode_reg = rinfo->save_regs[35];
- static u32 default_mrtable[] =
+ static const u32 default_mrtable[] =
{ 0x21320032,
0x21321000, 0xa1321000, 0x21321000, 0xffffffff,
0x21320032, 0xa1320032, 0x21320032, 0xffffffff,
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
index b00fc48..bf7f031 100644
--- a/sound/aoa/codecs/snd-aoa-codec-onyx.c
+++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c
@@ -1062,9 +1062,9 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
while ((dev = of_get_next_child(busnode, dev)) != NULL) {
if (device_is_compatible(dev, "pcm3052")) {
- u32 *addr;
+ const u32 *addr;
printk(KERN_DEBUG PFX "found pcm3052\n");
- addr = (u32 *) get_property(dev, "reg", NULL);
+ addr = get_property(dev, "reg", NULL);
if (!addr)
return -ENODEV;
return onyx_create(adapter, dev, (*addr)>>1);
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index 2cd81fa..ed6bdb0 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -939,9 +939,9 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
while ((dev = of_get_next_child(busnode, dev)) != NULL) {
if (device_is_compatible(dev, "tas3004")) {
- u32 *addr;
+ const u32 *addr;
printk(KERN_DEBUG PFX "found tas3004\n");
- addr = (u32 *) get_property(dev, "reg", NULL);
+ addr = get_property(dev, "reg", NULL);
if (!addr)
continue;
return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
@@ -950,7 +950,8 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
* property that says 'tas3004', they just have a 'deq'
* node without any such property... */
if (strcmp(dev->name, "deq") == 0) {
- u32 *_addr, addr;
+ const u32 *_addr;
+ u32 addr;
printk(KERN_DEBUG PFX "found 'deq' node\n");
_addr = (u32 *) get_property(dev, "i2c-address", NULL);
if (!_addr)
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 2b03bc7..d34e5db 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -55,7 +55,7 @@ static struct device_node *get_gpio(char *name,
int *gpioactiveptr)
{
struct device_node *np, *gpio;
- u32 *reg;
+ const u32 *reg;
const char *audio_gpio;
*gpioptr = -1;
@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name,
return NULL;
}
- reg = (u32 *)get_property(np, "reg", NULL);
+ reg = get_property(np, "reg", NULL);
if (!reg)
return NULL;
@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name,
if (*gpioptr < 0x50)
*gpioptr += 0x50;
- reg = (u32 *)get_property(np, "audio-gpio-active-state", NULL);
+ reg = get_property(np, "audio-gpio-active-state", NULL);
if (!reg)
/* Apple seems to default to 1, but
* that doesn't seem right at least on most
diff --git a/sound/aoa/fabrics/snd-aoa-fabric-layout.c b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
index 1b94ba6..7e38809 100644
--- a/sound/aoa/fabrics/snd-aoa-fabric-layout.c
+++ b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
@@ -724,7 +724,7 @@ static int check_codec(struct aoa_codec *codec,
struct layout_dev *ldev,
struct codec_connect_info *cci)
{
- u32 *ref;
+ const u32 *ref;
char propname[32];
struct codec_connection *cc;
@@ -732,7 +732,7 @@ static int check_codec(struct aoa_codec *codec,
if (codec->node && (strcmp(codec->node->name, "codec") == 0)) {
snprintf(propname, sizeof(propname),
"platform-%s-codec-ref", codec->name);
- ref = (u32*)get_property(ldev->sound, propname, NULL);
+ ref = get_property(ldev->sound, propname, NULL);
if (!ref) {
printk(KERN_INFO "snd-aoa-fabric-layout: "
"required property %s not present\n", propname);
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c
index 47b3e37..45680b5 100644
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -61,9 +61,10 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp,
{
struct soundbus_dev * soundbus_dev;
struct of_device * of;
- char *scratch, *compat, *compat2;
+ char *scratch;
+ const char *compat;
int i = 0;
- int length, cplen, cplen2, seen = 0;
+ int length, cplen, seen = 0;
if (!dev)
return -ENODEV;
@@ -95,9 +96,7 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp,
* it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */
- compat = (char *) get_property(of->node, "compatible", &cplen);
- compat2 = compat;
- cplen2= cplen;
+ compat = get_property(of->node, "compatible", &cplen);
while (compat && cplen > 0) {
envp[i++] = scratch;
length = scnprintf (scratch, buffer_size,
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
index e36f6aa..bbe50a0 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus-core.c
+++ b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
@@ -122,7 +122,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
{
struct device_node *parent;
int pindex, rc = -ENXIO;
- u32 *reg;
+ const u32 *reg;
/* Machines with layout 76 and 36 (K2 based) have a weird device
* tree what we need to special case.
@@ -141,7 +141,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
rc = of_address_to_resource(parent, pindex, res);
if (rc)
goto bail;
- reg = (u32 *)get_property(np, "reg", NULL);
+ reg = get_property(np, "reg", NULL);
if (reg == NULL) {
rc = -ENXIO;
goto bail;
@@ -188,8 +188,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
}
}
if (i == 1) {
- u32 *layout_id;
- layout_id = (u32*) get_property(sound, "layout-id", NULL);
+ const u32 *layout_id = get_property(sound, "layout-id", NULL);
if (layout_id) {
layout = *layout_id;
snprintf(dev->sound.modalias, 32,
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index f8a49bd..7aa4d43 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -578,7 +578,7 @@ tas_mixer_ioctl(u_int cmd, u_long arg)
}
static void __init
-tas_init_frame_rates(unsigned int *prop, unsigned int l)
+tas_init_frame_rates(const unsigned int *prop, unsigned int l)
{
int i ;
if (prop) {
@@ -2651,7 +2651,7 @@ get_expansion_type(void)
*/
static void __init
-awacs_init_frame_rates(unsigned int *prop, unsigned int l)
+awacs_init_frame_rates(const unsigned int *prop, unsigned int l)
{
int i ;
if (prop) {
@@ -2674,7 +2674,7 @@ awacs_init_frame_rates(unsigned int *prop, unsigned int l)
}
static void __init
-burgundy_init_frame_rates(unsigned int *prop, unsigned int l)
+burgundy_init_frame_rates(const unsigned int *prop, unsigned int l)
{
int temp[9] ;
int i = 0 ;
@@ -2700,7 +2700,7 @@ if (i > 1){
}
static void __init
-daca_init_frame_rates(unsigned int *prop, unsigned int l)
+daca_init_frame_rates(const unsigned int *prop, unsigned int l)
{
int temp[9] ;
int i = 0 ;
@@ -2727,7 +2727,7 @@ if (i > 1){
}
static void __init
-init_frame_rates(unsigned int *prop, unsigned int l)
+init_frame_rates(const unsigned int *prop, unsigned int l)
{
switch (awacs_revision) {
case AWACS_TUMBLER:
@@ -2972,21 +2972,21 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
*/
if (info) {
- unsigned int *prop, l;
+ const unsigned int *prop;
+ unsigned int l;
sound_device_id = 0;
/* device ID appears post g3 b&w */
- prop = (unsigned int *)get_property(info, "device-id", NULL);
+ prop = get_property(info, "device-id", NULL);
if (prop != 0)
sound_device_id = *prop;
/* look for a property saying what sample rates
are available */
- prop = (unsigned int *)get_property(info, "sample-rates", &l);
+ prop = get_property(info, "sample-rates", &l);
if (prop == 0)
- prop = (unsigned int *) get_property
- (info, "output-frame-rates", &l);
+ prop = get_property(info, "output-frame-rates", &l);
/* if it's there use it to set up frame rates */
init_frame_rates(prop, l) ;
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 665e85b..5e2c0ae 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -190,7 +190,7 @@ tas_cleanup(void)
int __init
tas_init(int driver_id, const char *driver_name)
{
- u32* paddr;
+ const u32* paddr;
printk(KERN_INFO "tas driver [%s])\n", driver_name);
@@ -200,7 +200,7 @@ tas_init(int driver_id, const char *driver_name)
tas_node = find_devices("deq");
if (tas_node == NULL)
return -ENODEV;
- paddr = (u32 *)get_property(tas_node, "i2c-address", NULL);
+ paddr = get_property(tas_node, "i2c-address", NULL);
if (paddr) {
tas_i2c_address = (*paddr) >> 1;
printk(KERN_INFO "using i2c address: 0x%x from device-tree\n",
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 2/6] [POWERPC] Rename get_property to of_get_property
2007-04-03 0:52 [PATCH 1/6] [POWERPC] get_property returns const Stephen Rothwell
@ 2007-04-03 0:54 ` Stephen Rothwell
2007-04-03 0:55 ` [PATCH 3/6] [POWERPC] Rename device_is_compatible to of_device_is_compatible Stephen Rothwell
2007-04-27 4:32 ` [PATCH] Partialially revert a7edd0e676d51145ae634a2acf7a447e319200fa Stephen Rothwell
1 sibling, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:54 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This is more consistent and gets us closer to the Sparc code.
We add a get_property define for compatibility during the change over.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 24 ++++++++++++------------
include/asm-powerpc/prom.h | 3 ++-
include/asm-ppc/prom.h | 3 ++-
3 files changed, 16 insertions(+), 14 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ef6bfb7..6224728 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -400,8 +400,8 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
}
if (allnextpp) {
*prev_pp = NULL;
- np->name = get_property(np, "name", NULL);
- np->type = get_property(np, "device_type", NULL);
+ np->name = of_get_property(np, "name", NULL);
+ np->type = of_get_property(np, "device_type", NULL);
if (!np->name)
np->name = "<NULL>";
@@ -1048,7 +1048,7 @@ prom_n_addr_cells(struct device_node* np)
do {
if (np->parent)
np = np->parent;
- ip = get_property(np, "#address-cells", NULL);
+ ip = of_get_property(np, "#address-cells", NULL);
if (ip != NULL)
return *ip;
} while (np->parent);
@@ -1064,7 +1064,7 @@ prom_n_size_cells(struct device_node* np)
do {
if (np->parent)
np = np->parent;
- ip = get_property(np, "#size-cells", NULL);
+ ip = of_get_property(np, "#size-cells", NULL);
if (ip != NULL)
return *ip;
} while (np->parent);
@@ -1136,7 +1136,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
const char* cp;
int cplen, l;
- cp = get_property(device, "compatible", &cplen);
+ cp = of_get_property(device, "compatible", &cplen);
if (cp == NULL)
return 0;
while (cplen > 0) {
@@ -1547,8 +1547,8 @@ static int of_finish_dynamic_node(struct device_node *node)
int err = 0;
const phandle *ibm_phandle;
- node->name = get_property(node, "name", NULL);
- node->type = get_property(node, "device_type", NULL);
+ node->name = of_get_property(node, "name", NULL);
+ node->type = of_get_property(node, "device_type", NULL);
if (!parent) {
err = -ENODEV;
@@ -1562,7 +1562,7 @@ static int of_finish_dynamic_node(struct device_node *node)
return -ENODEV;
/* fix up new node's linux_phandle field */
- if ((ibm_phandle = get_property(node, "ibm,phandle", NULL)))
+ if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
node->linux_phandle = *ibm_phandle;
out:
@@ -1625,13 +1625,13 @@ EXPORT_SYMBOL(of_find_property);
* Find a property with a given name for a given node
* and return the value.
*/
-const void *get_property(const struct device_node *np, const char *name,
+const void *of_get_property(const struct device_node *np, const char *name,
int *lenp)
{
struct property *pp = of_find_property(np,name,lenp);
return pp ? pp->value : NULL;
}
-EXPORT_SYMBOL(get_property);
+EXPORT_SYMBOL(of_get_property);
/*
* Add a property to a node
@@ -1762,10 +1762,10 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
/* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
* fallback to "reg" property and assume no threads
*/
- intserv = get_property(np, "ibm,ppc-interrupt-server#s",
+ intserv = of_get_property(np, "ibm,ppc-interrupt-server#s",
&plen);
if (intserv == NULL) {
- const u32 *reg = get_property(np, "reg", NULL);
+ const u32 *reg = of_get_property(np, "reg", NULL);
if (reg == NULL)
continue;
if (*reg == hardid) {
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 994de8e..448c5ce 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -165,9 +165,10 @@ extern void early_init_devtree(void *);
extern int device_is_compatible(const struct device_node *device,
const char *);
extern int machine_is_compatible(const char *compat);
-extern const void *get_property(const struct device_node *node,
+extern const void *of_get_property(const struct device_node *node,
const char *name,
int *lenp);
+#define get_property(a, b, c) of_get_property((a), (b), (c))
extern void print_properties(struct device_node *node);
extern int prom_n_addr_cells(struct device_node* np);
extern int prom_n_size_cells(struct device_node* np);
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index adc5ae7..901f7fa 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -34,7 +34,8 @@ extern unsigned long sub_reloc_offset(unsigned long);
*/
#define machine_is_compatible(x) 0
#define of_find_compatible_node(f, t, c) NULL
-#define get_property(p, n, l) NULL
+#define of_get_property(p, n, l) NULL
+#define get_property(a, b, c) of_get_property((a), (b), (c))
#endif /* _PPC_PROM_H */
#endif /* __KERNEL__ */
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 3/6] [POWERPC] Rename device_is_compatible to of_device_is_compatible
2007-04-03 0:54 ` [PATCH 2/6] [POWERPC] Rename get_property to of_get_property Stephen Rothwell
@ 2007-04-03 0:55 ` Stephen Rothwell
2007-04-03 0:56 ` [PATCH 4/6] [POWERPC] Rename prom_n_addr_cells to of_n_addr_cells Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:55 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This is more consistent and gets us closer to the Sparc code.
We add a device_is_compatible define for compatibility during the
change over.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 11 ++++++-----
include/asm-powerpc/prom.h | 3 ++-
2 files changed, 8 insertions(+), 6 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6224728..d2840b6 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1131,7 +1131,8 @@ EXPORT_SYMBOL(find_all_nodes);
/** Checks if the given "compat" string matches one of the strings in
* the device's "compatible" property
*/
-int device_is_compatible(const struct device_node *device, const char *compat)
+int of_device_is_compatible(const struct device_node *device,
+ const char *compat)
{
const char* cp;
int cplen, l;
@@ -1149,7 +1150,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
return 0;
}
-EXPORT_SYMBOL(device_is_compatible);
+EXPORT_SYMBOL(of_device_is_compatible);
/**
@@ -1163,7 +1164,7 @@ int machine_is_compatible(const char *compat)
root = of_find_node_by_path("/");
if (root) {
- rc = device_is_compatible(root, compat);
+ rc = of_device_is_compatible(root, compat);
of_node_put(root);
}
return rc;
@@ -1184,7 +1185,7 @@ struct device_node *find_compatible_devices(const char *type,
if (type != NULL
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
continue;
- if (device_is_compatible(np, compat)) {
+ if (of_device_is_compatible(np, compat)) {
*prevp = np;
prevp = &np->next;
}
@@ -1300,7 +1301,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
if (type != NULL
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
continue;
- if (device_is_compatible(np, compatible) && of_node_get(np))
+ if (of_device_is_compatible(np, compatible) && of_node_get(np))
break;
}
of_node_put(from);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 448c5ce..fcacc88 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -162,8 +162,9 @@ extern void of_detach_node(const struct device_node *);
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
extern void early_init_devtree(void *);
-extern int device_is_compatible(const struct device_node *device,
+extern int of_device_is_compatible(const struct device_node *device,
const char *);
+#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
extern int machine_is_compatible(const char *compat);
extern const void *of_get_property(const struct device_node *node,
const char *name,
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 4/6] [POWERPC] Rename prom_n_addr_cells to of_n_addr_cells
2007-04-03 0:55 ` [PATCH 3/6] [POWERPC] Rename device_is_compatible to of_device_is_compatible Stephen Rothwell
@ 2007-04-03 0:56 ` Stephen Rothwell
2007-04-03 0:57 ` [PATCH 5/6] [POWERPC] Rename prom_n_size_cells to of_n_size_cells Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:56 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This is more consistent and gets us closer to the Sparc code.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci_32.c | 2 +-
arch/powerpc/kernel/pci_64.c | 2 +-
arch/powerpc/kernel/prom.c | 5 ++---
arch/powerpc/kernel/prom_parse.c | 4 ++--
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/mm/numa.c | 2 +-
arch/powerpc/platforms/chrp/setup.c | 4 ++--
arch/powerpc/platforms/maple/setup.c | 2 +-
arch/powerpc/platforms/pasemi/setup.c | 2 +-
arch/powerpc/platforms/pseries/setup.c | 4 ++--
arch/powerpc/platforms/pseries/xics.c | 2 +-
drivers/char/tpm/tpm_atmel.h | 2 +-
include/asm-powerpc/prom.h | 2 +-
13 files changed, 17 insertions(+), 18 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index d8ef2e1..ecc7658 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -895,7 +895,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
int rlen = 0, orig_rlen;
int memno = 0;
struct resource *res;
- int np, na = prom_n_addr_cells(dev);
+ int np, na = of_n_addr_cells(dev);
np = na + 5;
/* First we try to merge ranges to fix a problem with some pmacs
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index db1d40e..84b4f66 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -957,7 +957,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
int rlen = 0;
int memno = 0;
struct resource *res;
- int np, na = prom_n_addr_cells(dev);
+ int np, na = of_n_addr_cells(dev);
unsigned long pci_addr, cpu_phys_addr;
np = na + 5;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d2840b6..08d6197 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1041,8 +1041,7 @@ void __init early_init_devtree(void *params)
#undef printk
-int
-prom_n_addr_cells(struct device_node* np)
+int of_n_addr_cells(struct device_node* np)
{
const int *ip;
do {
@@ -1055,7 +1054,7 @@ prom_n_addr_cells(struct device_node* np)
/* No #address-cells property for the root node, default to 1 */
return 1;
}
-EXPORT_SYMBOL(prom_n_addr_cells);
+EXPORT_SYMBOL(of_n_addr_cells);
int
prom_n_size_cells(struct device_node* np)
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 91b443c..e3d036f 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -68,7 +68,7 @@ static void of_bus_default_count_cells(struct device_node *dev,
int *addrc, int *sizec)
{
if (addrc)
- *addrc = prom_n_addr_cells(dev);
+ *addrc = of_n_addr_cells(dev);
if (sizec)
*sizec = prom_n_size_cells(dev);
}
@@ -654,7 +654,7 @@ void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
if (!prop)
prop = get_property(dn, "#address-cells", NULL);
- cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn);
+ cells = prop ? *(u32 *)prop : of_n_addr_cells(dn);
*phys = of_read_number(dma_window, cells);
dma_window += cells;
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d050d9a..54f449e 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -380,7 +380,7 @@ void __init smp_setup_cpu_maps(void)
int num_addr_cell, num_size_cell, maxcpus;
const unsigned int *ireg;
- num_addr_cell = prom_n_addr_cells(dn);
+ num_addr_cell = of_n_addr_cells(dn);
num_size_cell = prom_n_size_cells(dn);
ireg = get_property(dn, "ibm,lrdr-capacity", NULL);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index e86c37c..119cef9 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -201,7 +201,7 @@ static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)
if (!memory)
panic("numa.c: No memory nodes found!");
- *n_addr_cells = prom_n_addr_cells(memory);
+ *n_addr_cells = of_n_addr_cells(memory);
*n_size_cells = prom_n_size_cells(memory);
of_node_put(memory);
}
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 1edce72..c0d07fb 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -362,7 +362,7 @@ static void __init chrp_find_openpic(void)
root = of_find_node_by_path("/");
if (root) {
opprop = get_property(root, "platform-open-pic", &oplen);
- na = prom_n_addr_cells(root);
+ na = of_n_addr_cells(root);
}
if (opprop && oplen >= na * sizeof(unsigned int)) {
opaddr = opprop[na-1]; /* assume 32-bit */
@@ -469,7 +469,7 @@ static void __init chrp_find_8259(void)
if (addrp == NULL)
continue;
- chrp_int_ack = addrp[prom_n_addr_cells(np)-1];
+ chrp_int_ack = addrp[of_n_addr_cells(np)-1];
break;
}
if (np == NULL)
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 82d3f9e..a3f05c5 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -249,7 +249,7 @@ static void __init maple_init_IRQ(void)
/* Find address list in /platform-open-pic */
root = of_find_node_by_path("/");
- naddr = prom_n_addr_cells(root);
+ naddr = of_n_addr_cells(root);
opprop = get_property(root, "platform-open-pic", &opplen);
if (opprop != 0) {
openpic_addr = of_read_number(opprop, naddr);
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 449cf1a..d4fd613 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -136,7 +136,7 @@ static __init void pas_init_IRQ(void)
/* Find address list in /platform-open-pic */
root = of_find_node_by_path("/");
- naddr = prom_n_addr_cells(root);
+ naddr = of_n_addr_cells(root);
opprop = get_property(root, "platform-open-pic", &opplen);
if (!opprop) {
printk(KERN_ERR "No platform-open-pic property.\n");
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ff87b1a..54e93eb 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -139,7 +139,7 @@ static void __init pseries_mpic_init_IRQ(void)
struct mpic *mpic;
np = of_find_node_by_path("/");
- naddr = prom_n_addr_cells(np);
+ naddr = of_n_addr_cells(np);
opprop = get_property(np, "platform-open-pic", &opplen);
if (opprop != 0) {
openpic_addr = of_read_number(opprop, naddr);
@@ -193,7 +193,7 @@ static void __init pseries_mpic_init_IRQ(void)
NULL);
if (addrp == NULL)
continue;
- naddr = prom_n_addr_cells(np);
+ naddr = of_n_addr_cells(np);
intack = addrp[naddr-1];
if (naddr > 1)
intack |= ((unsigned long)addrp[naddr-2]) << 32;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 81d172d..f0795fa 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -643,7 +643,7 @@ static void __init xics_setup_8259_cascade(void)
addrp = get_property(np, "8259-interrupt-acknowledge", NULL);
if (addrp == NULL)
continue;
- naddr = prom_n_addr_cells(np);
+ naddr = of_n_addr_cells(np);
intack = addrp[naddr-1];
if (naddr > 1)
intack |= ((unsigned long)addrp[naddr-2]) << 32;
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index aefd683..3501c03 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -53,7 +53,7 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
}
reg = get_property(dn, "reg", ®len);
- naddrc = prom_n_addr_cells(dn);
+ naddrc = of_n_addr_cells(dn);
nsizec = prom_n_size_cells(dn);
of_node_put(dn);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index fcacc88..e0c92bf 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -171,7 +171,7 @@ extern const void *of_get_property(const struct device_node *node,
int *lenp);
#define get_property(a, b, c) of_get_property((a), (b), (c))
extern void print_properties(struct device_node *node);
-extern int prom_n_addr_cells(struct device_node* np);
+extern int of_n_addr_cells(struct device_node* np);
extern int prom_n_size_cells(struct device_node* np);
extern int prom_n_intr_cells(struct device_node* np);
extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 5/6] [POWERPC] Rename prom_n_size_cells to of_n_size_cells
2007-04-03 0:56 ` [PATCH 4/6] [POWERPC] Rename prom_n_addr_cells to of_n_addr_cells Stephen Rothwell
@ 2007-04-03 0:57 ` Stephen Rothwell
2007-04-03 0:58 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:57 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This is more consistent and gets us closer to the Sparc code.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 5 ++---
arch/powerpc/kernel/prom_parse.c | 4 ++--
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/mm/numa.c | 2 +-
drivers/char/tpm/tpm_atmel.h | 2 +-
include/asm-powerpc/prom.h | 2 +-
6 files changed, 8 insertions(+), 9 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 08d6197..2890ce3 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1056,8 +1056,7 @@ int of_n_addr_cells(struct device_node* np)
}
EXPORT_SYMBOL(of_n_addr_cells);
-int
-prom_n_size_cells(struct device_node* np)
+int of_n_size_cells(struct device_node* np)
{
const int* ip;
do {
@@ -1070,7 +1069,7 @@ prom_n_size_cells(struct device_node* np)
/* No #size-cells property for the root node, default to 1 */
return 1;
}
-EXPORT_SYMBOL(prom_n_size_cells);
+EXPORT_SYMBOL(of_n_size_cells);
/**
* Construct and return a list of the device_nodes with a given name.
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index e3d036f..ba9c7c1 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -70,7 +70,7 @@ static void of_bus_default_count_cells(struct device_node *dev,
if (addrc)
*addrc = of_n_addr_cells(dev);
if (sizec)
- *sizec = prom_n_size_cells(dev);
+ *sizec = of_n_size_cells(dev);
}
static u64 of_bus_default_map(u32 *addr, const u32 *range,
@@ -660,7 +660,7 @@ void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
dma_window += cells;
prop = get_property(dn, "ibm,#dma-size-cells", NULL);
- cells = prop ? *(u32 *)prop : prom_n_size_cells(dn);
+ cells = prop ? *(u32 *)prop : of_n_size_cells(dn);
*size = of_read_number(dma_window, cells);
}
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 54f449e..8e33526 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -381,7 +381,7 @@ void __init smp_setup_cpu_maps(void)
const unsigned int *ireg;
num_addr_cell = of_n_addr_cells(dn);
- num_size_cell = prom_n_size_cells(dn);
+ num_size_cell = of_n_size_cells(dn);
ireg = get_property(dn, "ibm,lrdr-capacity", NULL);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 119cef9..683839b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -202,7 +202,7 @@ static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)
panic("numa.c: No memory nodes found!");
*n_addr_cells = of_n_addr_cells(memory);
- *n_size_cells = prom_n_size_cells(memory);
+ *n_size_cells = of_n_size_cells(memory);
of_node_put(memory);
}
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 3501c03..3c85200 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -54,7 +54,7 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
reg = get_property(dn, "reg", ®len);
naddrc = of_n_addr_cells(dn);
- nsizec = prom_n_size_cells(dn);
+ nsizec = of_n_size_cells(dn);
of_node_put(dn);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index e0c92bf..fb068f2 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -172,7 +172,7 @@ extern const void *of_get_property(const struct device_node *node,
#define get_property(a, b, c) of_get_property((a), (b), (c))
extern void print_properties(struct device_node *node);
extern int of_n_addr_cells(struct device_node* np);
-extern int prom_n_size_cells(struct device_node* np);
+extern int of_n_size_cells(struct device_node* np);
extern int prom_n_intr_cells(struct device_node* np);
extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
extern int prom_add_property(struct device_node* np, struct property* prop);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 0:57 ` [PATCH 5/6] [POWERPC] Rename prom_n_size_cells to of_n_size_cells Stephen Rothwell
@ 2007-04-03 0:58 ` Stephen Rothwell
2007-04-03 3:37 ` David Miller
` (2 more replies)
0 siblings, 3 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 0:58 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/machine_kexec_64.c | 10 +++++-----
arch/powerpc/kernel/pci_32.c | 2 +-
arch/powerpc/kernel/prom.c | 5 +++--
arch/powerpc/platforms/maple/pci.c | 2 +-
arch/powerpc/platforms/powermac/pci.c | 2 +-
arch/powerpc/platforms/powermac/pfunc_core.c | 3 +--
drivers/macintosh/smu.c | 2 +-
fs/proc/proc_devtree.c | 2 +-
include/asm-powerpc/prom.h | 2 +-
9 files changed, 15 insertions(+), 15 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index a24b09c..b975b5b 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -294,19 +294,19 @@ static unsigned long htab_base, kernel_end;
static struct property htab_base_prop = {
.name = "linux,htab-base",
.length = sizeof(unsigned long),
- .value = (unsigned char *)&htab_base,
+ .value = &htab_base,
};
static struct property htab_size_prop = {
.name = "linux,htab-size",
.length = sizeof(unsigned long),
- .value = (unsigned char *)&htab_size_bytes,
+ .value = &htab_size_bytes,
};
static struct property kernel_end_prop = {
.name = "linux,kernel-end",
.length = sizeof(unsigned long),
- .value = (unsigned char *)&kernel_end,
+ .value = &kernel_end,
};
static void __init export_htab_values(void)
@@ -335,7 +335,7 @@ static void __init export_htab_values(void)
static struct property crashk_base_prop = {
.name = "linux,crashkernel-base",
.length = sizeof(unsigned long),
- .value = (unsigned char *)&crashk_res.start,
+ .value = &crashk_res.start,
};
static unsigned long crashk_size;
@@ -343,7 +343,7 @@ static unsigned long crashk_size;
static struct property crashk_size_prop = {
.name = "linux,crashkernel-size",
.length = sizeof(unsigned long),
- .value = (unsigned char *)&crashk_size,
+ .value = &crashk_size,
};
static void __init export_crashk_values(void)
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index ecc7658..e99ffe2 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -1012,7 +1012,7 @@ pci_create_OF_bus_map(void)
memset(of_prop, -1, sizeof(struct property) + 256);
of_prop->name = "pci-OF-bus-map";
of_prop->length = 256;
- of_prop->value = (unsigned char *)&of_prop[1];
+ of_prop->value = &of_prop[1];
prom_add_property(find_path_device("/"), of_prop);
}
}
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 2890ce3..ec6921c 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -390,12 +390,13 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
if (allnextpp) {
pp->name = "name";
pp->length = sz;
- pp->value = (unsigned char *)(pp + 1);
+ pp->value = pp + 1;
*prev_pp = pp;
prev_pp = &pp->next;
memcpy(pp->value, ps, sz - 1);
((char *)pp->value)[sz - 1] = 0;
- DBG("fixed up name for %s -> %s\n", pathp, pp->value);
+ DBG("fixed up name for %s -> %s\n", pathp,
+ (char *)pp->value);
}
}
if (allnextpp) {
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 73c5990..ab5a6f1 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -77,7 +77,7 @@ static void __init fixup_bus_range(struct device_node *bridge)
bridge->full_name);
return;
}
- bus_range = (int *)prop->value;
+ bus_range = prop->value;
bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
}
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 6fbac30..431a685 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -100,7 +100,7 @@ static void __init fixup_bus_range(struct device_node *bridge)
if (prop == NULL || prop->length < 2 * sizeof(int))
return;
- bus_range = (int *)prop->value;
+ bus_range = prop->value;
bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
}
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 7651f27..a128553 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -692,8 +692,7 @@ static int pmf_add_functions(struct pmf_device *dev, void *driverdata)
name = pp->name + plen;
if (strlen(name) && pp->length >= 12)
count += pmf_add_function_prop(dev, driverdata, name,
- (u32 *)pp->value,
- pp->length);
+ pp->value, pp->length);
}
return count;
}
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 3096836..45bb3c1 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -952,7 +952,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
prop->name = ((char *)prop) + tlen - 18;
sprintf(prop->name, "sdb-partition-%02x", id);
prop->length = len;
- prop->value = (unsigned char *)hdr;
+ prop->value = hdr;
prop->next = NULL;
/* Read the datablock */
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index abdf068..eca471b 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -38,7 +38,7 @@ static int property_read_proc(char *page, char **start, off_t off,
n = count;
else
*eof = 1;
- memcpy(page, pp->value + off, n);
+ memcpy(page, (char *)pp->value + off, n);
*start = page;
return n;
}
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index fb068f2..e73a2b4 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -71,7 +71,7 @@ typedef u32 ihandle;
struct property {
char *name;
int length;
- unsigned char *value;
+ void *value;
struct property *next;
};
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 0:58 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Stephen Rothwell
@ 2007-04-03 3:37 ` David Miller
2007-04-03 15:40 ` Segher Boessenkool
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
2007-04-03 15:39 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Segher Boessenkool
2 siblings, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-03 3:37 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 3 Apr 2007 10:58:52 +1000
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>From my perspective these look fine, of course.
Stephen, thanks for continuing to work on this OFW code sharing stuff,
I very much appreciate it!
^ permalink raw reply [flat|nested] 109+ messages in thread
* [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include
2007-04-03 0:58 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Stephen Rothwell
2007-04-03 3:37 ` David Miller
@ 2007-04-03 12:24 ` Stephen Rothwell
2007-04-03 12:26 ` [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel Stephen Rothwell
` (2 more replies)
2007-04-03 15:39 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Segher Boessenkool
2 siblings, 3 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:24 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/parport.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
This set of patches follows the previous 6. The whole lot have been
built with allmodconfig on PowerPC64.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/parport.h b/include/asm-powerpc/parport.h
index 3fca21d..b37b81e 100644
--- a/include/asm-powerpc/parport.h
+++ b/include/asm-powerpc/parport.h
@@ -20,18 +20,18 @@ extern struct parport *parport_pc_probe_port (unsigned long int base,
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
{
struct device_node *np;
- u32 *prop;
+ const u32 *prop;
u32 io1, io2;
int propsize;
int count = 0;
for (np = NULL; (np = of_find_compatible_node(np,
"parallel",
"pnpPNP,400")) != NULL;) {
- prop = (u32 *)get_property(np, "reg", &propsize);
+ prop = of_get_property(np, "reg", &propsize);
if (!prop || propsize > 6*sizeof(u32))
continue;
io1 = prop[1]; io2 = prop[2];
- prop = (u32 *)get_property(np, "interrupts", NULL);
+ prop = of_get_property(np, "interrupts", NULL);
if (!prop)
continue;
if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
@ 2007-04-03 12:26 ` Stephen Rothwell
2007-04-03 12:28 ` [PATCH 03/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/mm Stephen Rothwell
2007-04-03 17:36 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Olof Johansson
2007-04-05 1:49 ` Benjamin Herrenschmidt
2 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:26 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/btext.c | 22 ++++++++--------
arch/powerpc/kernel/ibmebus.c | 22 +++++++---------
arch/powerpc/kernel/legacy_serial.c | 24 +++++++++---------
arch/powerpc/kernel/lparcfg.c | 9 +++---
arch/powerpc/kernel/machine_kexec_64.c | 4 +-
arch/powerpc/kernel/of_platform.c | 4 +-
arch/powerpc/kernel/pci_32.c | 14 +++++-----
arch/powerpc/kernel/pci_64.c | 16 ++++++------
arch/powerpc/kernel/pci_dn.c | 9 +++---
arch/powerpc/kernel/prom_parse.c | 43 +++++++++++++++----------------
arch/powerpc/kernel/rtas-proc.c | 4 +-
arch/powerpc/kernel/rtas.c | 16 ++++++------
arch/powerpc/kernel/rtas_pci.c | 10 +++---
arch/powerpc/kernel/setup-common.c | 7 +++--
arch/powerpc/kernel/setup_64.c | 10 +++---
arch/powerpc/kernel/sysfs.c | 2 +-
arch/powerpc/kernel/time.c | 2 +-
arch/powerpc/kernel/vio.c | 14 +++++-----
18 files changed, 116 insertions(+), 116 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index 3678997..e7b6846 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -161,33 +161,33 @@ int btext_initialize(struct device_node *np)
unsigned long address = 0;
const u32 *prop;
- prop = get_property(np, "linux,bootx-width", NULL);
+ prop = of_get_property(np, "linux,bootx-width", NULL);
if (prop == NULL)
- prop = get_property(np, "width", NULL);
+ prop = of_get_property(np, "width", NULL);
if (prop == NULL)
return -EINVAL;
width = *prop;
- prop = get_property(np, "linux,bootx-height", NULL);
+ prop = of_get_property(np, "linux,bootx-height", NULL);
if (prop == NULL)
- prop = get_property(np, "height", NULL);
+ prop = of_get_property(np, "height", NULL);
if (prop == NULL)
return -EINVAL;
height = *prop;
- prop = get_property(np, "linux,bootx-depth", NULL);
+ prop = of_get_property(np, "linux,bootx-depth", NULL);
if (prop == NULL)
- prop = get_property(np, "depth", NULL);
+ prop = of_get_property(np, "depth", NULL);
if (prop == NULL)
return -EINVAL;
depth = *prop;
pitch = width * ((depth + 7) / 8);
- prop = get_property(np, "linux,bootx-linebytes", NULL);
+ prop = of_get_property(np, "linux,bootx-linebytes", NULL);
if (prop == NULL)
- prop = get_property(np, "linebytes", NULL);
+ prop = of_get_property(np, "linebytes", NULL);
if (prop && *prop != 0xffffffffu)
pitch = *prop;
if (pitch == 1)
pitch = 0x1000;
- prop = get_property(np, "address", NULL);
+ prop = of_get_property(np, "address", NULL);
if (prop)
address = *prop;
@@ -219,7 +219,7 @@ int __init btext_find_display(int allow_nonstdout)
struct device_node *np = NULL;
int rc = -ENODEV;
- name = get_property(of_chosen, "linux,stdout-path", NULL);
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (name != NULL) {
np = of_find_node_by_path(name);
if (np != NULL) {
@@ -236,7 +236,7 @@ int __init btext_find_display(int allow_nonstdout)
return rc;
for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
- if (get_property(np, "linux,opened", NULL)) {
+ if (of_get_property(np, "linux,opened", NULL)) {
printk("trying %s ...\n", np->full_name);
rc = btext_initialize(np);
printk("result: %d\n", rc);
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 8ed1163..48446a6 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -193,7 +193,7 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node(
const char *loc_code;
int length;
- loc_code = get_property(dn, "ibm,loc-code", NULL);
+ loc_code = of_get_property(dn, "ibm,loc-code", NULL);
if (!loc_code) {
printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n",
__FUNCTION__, dn->name ? dn->name : "<unknown>");
@@ -256,12 +256,11 @@ static void ibmebus_add_devices_by_id(struct of_device_id *idt)
static int ibmebus_match_helper_name(struct device *dev, void *data)
{
const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
- char *name;
+ const char *name;
- name = (char*)get_property(
- ebus_dev->ofdev.node, "name", NULL);
+ name = of_get_property(ebus_dev->ofdev.node, "name", NULL);
- if (name && (strcmp((char*)data, name) == 0))
+ if (name && (strcmp(data, name) == 0))
return 1;
return 0;
@@ -363,7 +362,7 @@ static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
- char *name = (char*)get_property(ebus_dev->ofdev.node, "name", NULL);
+ const char *name = of_get_property(ebus_dev->ofdev.node, "name", NULL);
return sprintf(buf, "%s\n", name);
}
@@ -375,12 +374,11 @@ static struct device_attribute ibmebus_dev_attrs[] = {
static int ibmebus_match_helper_loc_code(struct device *dev, void *data)
{
const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
- char *loc_code;
+ const char *loc_code;
- loc_code = (char*)get_property(
- ebus_dev->ofdev.node, "ibm,loc-code", NULL);
+ loc_code = of_get_property(ebus_dev->ofdev.node, "ibm,loc-code", NULL);
- if (loc_code && (strcmp((char*)data, loc_code) == 0))
+ if (loc_code && (strcmp(data, loc_code) == 0))
return 1;
return 0;
@@ -391,7 +389,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
{
struct device_node *dn = NULL;
struct ibmebus_dev *dev;
- char *loc_code;
+ const char *loc_code;
char parm[MAX_LOC_CODE_LENGTH];
if (count >= MAX_LOC_CODE_LENGTH)
@@ -409,7 +407,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
}
while ((dn = of_find_all_nodes(dn))) {
- loc_code = (char *)get_property(dn, "ibm,loc-code", NULL);
+ loc_code = of_get_property(dn, "ibm,loc-code", NULL);
if (loc_code && (strncmp(loc_code, parm, count) == 0)) {
dev = ibmebus_register_device_node(dn);
if (IS_ERR(dev)) {
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 325f490..63dd2c3 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -44,12 +44,12 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
int index;
/* get clock freq. if present */
- clk = get_property(np, "clock-frequency", NULL);
+ clk = of_get_property(np, "clock-frequency", NULL);
if (clk && *clk)
clock = *clk;
/* get default speed if present */
- spd = get_property(np, "current-speed", NULL);
+ spd = of_get_property(np, "current-speed", NULL);
/* If we have a location index, then try to use it */
if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS)
@@ -121,11 +121,11 @@ static int __init add_legacy_soc_port(struct device_node *np,
/* We only support ports that have a clock frequency properly
* encoded in the device-tree.
*/
- if (get_property(np, "clock-frequency", NULL) == NULL)
+ if (of_get_property(np, "clock-frequency", NULL) == NULL)
return -1;
/* if rtas uses this device, don't try to use it as well */
- if (get_property(np, "used-by-rtas", NULL) != NULL)
+ if (of_get_property(np, "used-by-rtas", NULL) != NULL)
return -1;
/* Get the address */
@@ -157,7 +157,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
/* Get the ISA port number */
- reg = get_property(np, "reg", NULL);
+ reg = of_get_property(np, "reg", NULL);
if (reg == NULL)
return -1;
@@ -168,7 +168,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
/* Now look for an "ibm,aix-loc" property that gives us ordering
* if any...
*/
- typep = get_property(np, "ibm,aix-loc", NULL);
+ typep = of_get_property(np, "ibm,aix-loc", NULL);
/* If we have a location index, then use it */
if (typep && *typep == 'S')
@@ -206,7 +206,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
* compatible UARTs on PCI need all sort of quirks (port offsets
* etc...) that this code doesn't know about
*/
- if (get_property(np, "clock-frequency", NULL) == NULL)
+ if (of_get_property(np, "clock-frequency", NULL) == NULL)
return -1;
/* Get the PCI address. Assume BAR 0 */
@@ -232,7 +232,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
* we get to their "reg" property
*/
if (np != pci_dev) {
- const u32 *reg = get_property(np, "reg", NULL);
+ const u32 *reg = of_get_property(np, "reg", NULL);
if (reg && (*reg < 4))
index = lindex = *reg;
}
@@ -296,7 +296,7 @@ void __init find_legacy_serial_ports(void)
DBG(" -> find_legacy_serial_port()\n");
/* Now find out if one of these is out firmware console */
- path = get_property(of_chosen, "linux,stdout-path", NULL);
+ path = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (path != NULL) {
stdout = of_find_node_by_path(path);
if (stdout)
@@ -529,7 +529,7 @@ static int __init check_legacy_serial_console(void)
}
/* We are getting a weird phandle from OF ... */
/* ... So use the full path instead */
- name = get_property(of_chosen, "linux,stdout-path", NULL);
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (name == NULL) {
DBG(" no linux,stdout-path !\n");
return -ENODEV;
@@ -541,12 +541,12 @@ static int __init check_legacy_serial_console(void)
}
DBG("stdout is %s\n", prom_stdout->full_name);
- name = get_property(prom_stdout, "name", NULL);
+ name = of_get_property(prom_stdout, "name", NULL);
if (!name) {
DBG(" stdout package has no name !\n");
goto not_found;
}
- spd = get_property(prom_stdout, "current-speed", NULL);
+ spd = of_get_property(prom_stdout, "current-speed", NULL);
if (spd)
speed = *spd;
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 89486b6..b8dc1ee 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -323,7 +323,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
rtas_node = find_path_device("/rtas");
if (rtas_node)
- lrdrp = get_property(rtas_node, "ibm,lrdr-capacity", NULL);
+ lrdrp = of_get_property(rtas_node, "ibm,lrdr-capacity", NULL);
if (lrdrp == NULL) {
partition_potential_processors = vdso_data->processorCount;
@@ -539,21 +539,22 @@ static int lparcfg_data(struct seq_file *m, void *v)
rootdn = find_path_device("/");
if (rootdn) {
- tmp = get_property(rootdn, "model", NULL);
+ tmp = of_get_property(rootdn, "model", NULL);
if (tmp) {
model = tmp;
/* Skip "IBM," - see platforms/iseries/dt.c */
if (firmware_has_feature(FW_FEATURE_ISERIES))
model += 4;
}
- tmp = get_property(rootdn, "system-id", NULL);
+ tmp = of_get_property(rootdn, "system-id", NULL);
if (tmp) {
system_id = tmp;
/* Skip "IBM," - see platforms/iseries/dt.c */
if (firmware_has_feature(FW_FEATURE_ISERIES))
system_id += 4;
}
- lp_index_ptr = get_property(rootdn, "ibm,partition-no", NULL);
+ lp_index_ptr = of_get_property(rootdn, "ibm,partition-no",
+ NULL);
if (lp_index_ptr)
lp_index = *lp_index_ptr;
}
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index b975b5b..704375b 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -72,8 +72,8 @@ int default_machine_kexec_prepare(struct kimage *image)
/* We also should not overwrite the tce tables */
for (node = of_find_node_by_type(NULL, "pci"); node != NULL;
node = of_find_node_by_type(node, "pci")) {
- basep = get_property(node, "linux,tce-base", NULL);
- sizep = get_property(node, "linux,tce-size", NULL);
+ basep = of_get_property(node, "linux,tce-base", NULL);
+ sizep = of_get_property(node, "linux,tce-size", NULL);
if (basep == NULL || sizep == NULL)
continue;
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index b734517..07324ae 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -177,7 +177,7 @@ static void of_platform_make_bus_id(struct of_device *dev)
* and 'D' for MMIO DCRs.
*/
#ifdef CONFIG_PPC_DCR
- reg = get_property(node, "dcr-reg", NULL);
+ reg = of_get_property(node, "dcr-reg", NULL);
if (reg) {
#ifdef CONFIG_PPC_DCR_NATIVE
snprintf(name, BUS_ID_SIZE, "d%x.%s",
@@ -197,7 +197,7 @@ static void of_platform_make_bus_id(struct of_device *dev)
/*
* For MMIO, get the physical address
*/
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
if (reg) {
addr = of_translate_address(node, reg);
if (addr != OF_BAD_ADDR) {
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index e99ffe2..ae04f94 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -637,7 +637,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
if (pci_bus >= pci_bus_count)
return;
- bus_range = get_property(node, "bus-range", &len);
+ bus_range = of_get_property(node, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, "
"assuming it starts at 0\n", node->full_name);
@@ -649,11 +649,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
struct pci_dev* dev;
const unsigned int *class_code, *reg;
- class_code = get_property(node, "class-code", NULL);
+ class_code = of_get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
if (!reg)
continue;
dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
@@ -724,7 +724,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
* a fake root for all functions of a multi-function device,
* we go down them as well.
*/
- class_code = get_property(node, "class-code", NULL);
+ class_code = of_get_property(node, "class-code", NULL);
if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
strcmp(node->name, "multifunc-device"))
@@ -744,7 +744,7 @@ static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
unsigned int psize;
while ((np = of_get_next_child(parent, np)) != NULL) {
- reg = get_property(np, "reg", &psize);
+ reg = of_get_property(np, "reg", &psize);
if (reg == NULL || psize < 4)
continue;
if (((reg[0] >> 8) & 0xff) == devfn)
@@ -859,7 +859,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
find_OF_pci_device_filter, (void *)node))
return -ENODEV;
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
if (!reg)
return -ENODEV;
*bus = (reg[0] >> 16) & 0xff;
@@ -902,7 +902,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
* that can have more than 3 ranges, fortunately using contiguous
* addresses -- BenH
*/
- dt_ranges = get_property(dev, "ranges", &rlen);
+ dt_ranges = of_get_property(dev, "ranges", &rlen);
if (!dt_ranges)
return;
/* Sanity check, though hopefully that never happens */
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 84b4f66..60d7d4b 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -268,7 +268,7 @@ static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
const u32 *prop;
int len;
- prop = get_property(np, name, &len);
+ prop = of_get_property(np, name, &len);
if (prop && len >= 4)
return *prop;
return def;
@@ -301,7 +301,7 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
u32 i;
int proplen;
- addrs = get_property(node, "assigned-addresses", &proplen);
+ addrs = of_get_property(node, "assigned-addresses", &proplen);
if (!addrs)
return;
DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
@@ -343,7 +343,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
if (!dev)
return NULL;
- type = get_property(node, "device_type", NULL);
+ type = of_get_property(node, "device_type", NULL);
if (type == NULL)
type = "";
@@ -407,7 +407,7 @@ void __devinit of_scan_bus(struct device_node *node,
while ((child = of_get_next_child(node, child)) != NULL) {
DBG(" * %s\n", child->full_name);
- reg = get_property(child, "reg", ®len);
+ reg = of_get_property(child, "reg", ®len);
if (reg == NULL || reglen < 20)
continue;
devfn = (reg[0] >> 8) & 0xff;
@@ -440,13 +440,13 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
DBG("of_scan_pci_bridge(%s)\n", node->full_name);
/* parse bus-range property */
- busrange = get_property(node, "bus-range", &len);
+ busrange = of_get_property(node, "bus-range", &len);
if (busrange == NULL || len != 8) {
printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n",
node->full_name);
return;
}
- ranges = get_property(node, "ranges", &len);
+ ranges = of_get_property(node, "ranges", &len);
if (ranges == NULL) {
printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n",
node->full_name);
@@ -910,7 +910,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
unsigned int size;
int rlen = 0;
- range = get_property(isa_node, "ranges", &rlen);
+ range = of_get_property(isa_node, "ranges", &rlen);
if (range == NULL || (rlen < sizeof(struct isa_range))) {
printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
"mapping 64k\n");
@@ -970,7 +970,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
* (size depending on dev->n_addr_cells)
* cells 4+5 or 5+6: the size of the range
*/
- ranges = get_property(dev, "ranges", &rlen);
+ ranges = of_get_property(dev, "ranges", &rlen);
if (ranges == NULL)
return;
hose->io_base_phys = 0;
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 68df018..d7d36df 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -40,7 +40,8 @@
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
- const int *type = get_property(dn, "ibm,pci-config-space-type", NULL);
+ const int *type =
+ of_get_property(dn, "ibm,pci-config-space-type", NULL);
const u32 *regs;
struct pci_dn *pdn;
@@ -54,14 +55,14 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
dn->data = pdn;
pdn->node = dn;
pdn->phb = phb;
- regs = get_property(dn, "reg", NULL);
+ regs = of_get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
pdn->busno = (regs[0] >> 16) & 0xff;
pdn->devfn = (regs[0] >> 8) & 0xff;
}
if (firmware_has_feature(FW_FEATURE_ISERIES)) {
- const u32 *busp = get_property(dn, "linux,subbus", NULL);
+ const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
if (busp)
pdn->bussubno = *busp;
}
@@ -100,7 +101,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
u32 class;
nextdn = NULL;
- classp = get_property(dn, "class-code", NULL);
+ classp = of_get_property(dn, "class-code", NULL);
class = classp ? *classp : 0;
if (pre && ((ret = pre(dn, data)) != NULL))
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index ba9c7c1..aa40a53 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -196,7 +196,7 @@ const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
return NULL;
/* Get "reg" or "assigned-addresses" property */
- prop = get_property(dev, bus->addresses, &psize);
+ prop = of_get_property(dev, bus->addresses, &psize);
if (prop == NULL)
return NULL;
psize /= 4;
@@ -438,7 +438,7 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
* to translate addresses that aren't supposed to be translated in
* the first place. --BenH.
*/
- ranges = get_property(parent, "ranges", &rlen);
+ ranges = of_get_property(parent, "ranges", &rlen);
if (ranges == NULL || rlen == 0) {
offset = of_read_number(addr, na);
memset(addr, 0, pna * 4);
@@ -578,7 +578,7 @@ const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
return NULL;
/* Get "reg" or "assigned-addresses" property */
- prop = get_property(dev, bus->addresses, &psize);
+ prop = of_get_property(dev, bus->addresses, &psize);
if (prop == NULL)
return NULL;
psize /= 4;
@@ -650,16 +650,16 @@ void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
/* busno is always one cell */
*busno = *(dma_window++);
- prop = get_property(dn, "ibm,#dma-address-cells", NULL);
+ prop = of_get_property(dn, "ibm,#dma-address-cells", NULL);
if (!prop)
- prop = get_property(dn, "#address-cells", NULL);
+ prop = of_get_property(dn, "#address-cells", NULL);
cells = prop ? *(u32 *)prop : of_n_addr_cells(dn);
*phys = of_read_number(dma_window, cells);
dma_window += cells;
- prop = get_property(dn, "ibm,#dma-size-cells", NULL);
+ prop = of_get_property(dn, "ibm,#dma-size-cells", NULL);
cells = prop ? *(u32 *)prop : of_n_size_cells(dn);
*size = of_read_number(dma_window, cells);
}
@@ -680,7 +680,7 @@ static struct device_node *of_irq_find_parent(struct device_node *child)
return NULL;
do {
- parp = get_property(child, "interrupt-parent", NULL);
+ parp = of_get_property(child, "interrupt-parent", NULL);
if (parp == NULL)
p = of_get_parent(child);
else {
@@ -691,7 +691,7 @@ static struct device_node *of_irq_find_parent(struct device_node *child)
}
of_node_put(child);
child = p;
- } while (p && get_property(p, "#interrupt-cells", NULL) == NULL);
+ } while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL);
return p;
}
@@ -716,7 +716,7 @@ void of_irq_map_init(unsigned int flags)
struct device_node *np;
for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) {
- if (get_property(np, "interrupt-controller", NULL)
+ if (of_get_property(np, "interrupt-controller", NULL)
== NULL)
continue;
/* Skip /chosen/interrupt-controller */
@@ -755,7 +755,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
* is none, we are nice and just walk up the tree
*/
do {
- tmp = get_property(ipar, "#interrupt-cells", NULL);
+ tmp = of_get_property(ipar, "#interrupt-cells", NULL);
if (tmp != NULL) {
intsize = *tmp;
break;
@@ -779,7 +779,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
*/
old = of_node_get(ipar);
do {
- tmp = get_property(old, "#address-cells", NULL);
+ tmp = of_get_property(old, "#address-cells", NULL);
tnode = of_get_parent(old);
of_node_put(old);
old = tnode;
@@ -795,7 +795,8 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
/* Now check if cursor is an interrupt-controller and if it is
* then we are done
*/
- if (get_property(ipar, "interrupt-controller", NULL) != NULL) {
+ if (of_get_property(ipar, "interrupt-controller", NULL) !=
+ NULL) {
DBG(" -> got it !\n");
memcpy(out_irq->specifier, intspec,
intsize * sizeof(u32));
@@ -806,7 +807,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
}
/* Now look for an interrupt-map */
- imap = get_property(ipar, "interrupt-map", &imaplen);
+ imap = of_get_property(ipar, "interrupt-map", &imaplen);
/* No interrupt map, check for an interrupt parent */
if (imap == NULL) {
DBG(" -> no map, getting parent\n");
@@ -816,7 +817,7 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
imaplen /= sizeof(u32);
/* Look for a mask */
- imask = get_property(ipar, "interrupt-map-mask", NULL);
+ imask = of_get_property(ipar, "interrupt-map-mask", NULL);
/* If we were passed no "reg" property and we attempt to parse
* an interrupt-map, then #address-cells must be 0.
@@ -863,15 +864,13 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
/* Get #interrupt-cells and #address-cells of new
* parent
*/
- tmp = get_property(newpar, "#interrupt-cells",
- NULL);
+ tmp = of_get_property(newpar, "#interrupt-cells", NULL);
if (tmp == NULL) {
DBG(" -> parent lacks #interrupt-cells !\n");
goto fail;
}
newintsize = *tmp;
- tmp = get_property(newpar, "#address-cells",
- NULL);
+ tmp = of_get_property(newpar, "#address-cells", NULL);
newaddrsize = (tmp == NULL) ? 0 : *tmp;
DBG(" -> newintsize=%d, newaddrsize=%d\n",
@@ -928,7 +927,7 @@ static int of_irq_map_oldworld(struct device_node *device, int index,
* everything together on these)
*/
while (device) {
- ints = get_property(device, "AAPL,interrupts", &intlen);
+ ints = of_get_property(device, "AAPL,interrupts", &intlen);
if (ints != NULL)
break;
device = device->parent;
@@ -970,13 +969,13 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
return of_irq_map_oldworld(device, index, out_irq);
/* Get the interrupts property */
- intspec = get_property(device, "interrupts", &intlen);
+ intspec = of_get_property(device, "interrupts", &intlen);
if (intspec == NULL)
return -EINVAL;
intlen /= sizeof(u32);
/* Get the reg property (if any) */
- addr = get_property(device, "reg", NULL);
+ addr = of_get_property(device, "reg", NULL);
/* Look for the interrupt parent. */
p = of_irq_find_parent(device);
@@ -984,7 +983,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
return -EINVAL;
/* Get size of interrupt specifier */
- tmp = get_property(p, "#interrupt-cells", NULL);
+ tmp = of_get_property(p, "#interrupt-cells", NULL);
if (tmp == NULL) {
of_node_put(p);
return -EINVAL;
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 6cbf2ae..190b7ed 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -450,7 +450,7 @@ static int ppc_rtas_sensors_show(struct seq_file *m, void *v)
int llen, offs;
sprintf (rstr, SENSOR_PREFIX"%04d", p->token);
- loc = get_property(rtas_node, rstr, &llen);
+ loc = of_get_property(rtas_node, rstr, &llen);
/* A sensor may have multiple instances */
for (j = 0, offs = 0; j <= p->quant; j++) {
@@ -477,7 +477,7 @@ static int ppc_rtas_find_all_sensors(void)
const unsigned int *utmp;
int len, i;
- utmp = get_property(rtas_node, "rtas-sensors", &len);
+ utmp = of_get_property(rtas_node, "rtas-sensors", &len);
if (utmp == NULL) {
printk (KERN_ERR "error: could not get rtas-sensors\n");
return 1;
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 9d0735a..702fecc 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -193,16 +193,16 @@ void rtas_progress(char *s, unsigned short hex)
if (display_width == 0) {
display_width = 0x10;
if ((root = find_path_device("/rtas"))) {
- if ((p = get_property(root,
+ if ((p = of_get_property(root,
"ibm,display-line-length", NULL)))
display_width = *p;
- if ((p = get_property(root,
+ if ((p = of_get_property(root,
"ibm,form-feed", NULL)))
form_feed = *p;
- if ((p = get_property(root,
+ if ((p = of_get_property(root,
"ibm,display-number-of-lines", NULL)))
display_lines = *p;
- row_width = get_property(root,
+ row_width = of_get_property(root,
"ibm,display-truncation-length", NULL);
}
display_character = rtas_token("display-character");
@@ -298,7 +298,7 @@ int rtas_token(const char *service)
const int *tokp;
if (rtas.dev == NULL)
return RTAS_UNKNOWN_SERVICE;
- tokp = get_property(rtas.dev, service, NULL);
+ tokp = of_get_property(rtas.dev, service, NULL);
return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
}
EXPORT_SYMBOL(rtas_token);
@@ -832,12 +832,12 @@ void __init rtas_initialize(void)
if (rtas.dev) {
const u32 *basep, *entryp, *sizep;
- basep = get_property(rtas.dev, "linux,rtas-base", NULL);
- sizep = get_property(rtas.dev, "rtas-size", NULL);
+ basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
+ sizep = of_get_property(rtas.dev, "rtas-size", NULL);
if (basep != NULL && sizep != NULL) {
rtas.base = *basep;
rtas.size = *sizep;
- entryp = get_property(rtas.dev,
+ entryp = of_get_property(rtas.dev,
"linux,rtas-entry", NULL);
if (entryp == NULL) /* Ugh */
rtas.entry = rtas.base;
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 1616a44..f228682 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -60,7 +60,7 @@ static int of_device_available(struct device_node * dn)
{
const char *status;
- status = get_property(dn, "status", NULL);
+ status = of_get_property(dn, "status", NULL);
if (!status)
return 1;
@@ -177,7 +177,7 @@ struct pci_ops rtas_pci_ops = {
int is_python(struct device_node *dev)
{
- const char *model = get_property(dev, "model", NULL);
+ const char *model = of_get_property(dev, "model", NULL);
if (model && strstr(model, "Python"))
return 1;
@@ -247,7 +247,7 @@ static int phb_set_bus_ranges(struct device_node *dev,
const int *bus_range;
unsigned int len;
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
return 1;
}
@@ -309,12 +309,12 @@ void __init find_and_init_phbs(void)
if (of_chosen) {
const int *prop;
- prop = get_property(of_chosen,
+ prop = of_get_property(of_chosen,
"linux,pci-probe-only", NULL);
if (prop)
pci_probe_only = *prop;
- prop = get_property(of_chosen,
+ prop = of_get_property(of_chosen,
"linux,pci-assign-all-buses", NULL);
if (prop)
pci_assign_all_buses = *prop;
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 8e33526..43055ad 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -353,11 +353,12 @@ void __init smp_setup_cpu_maps(void)
const int *intserv;
int j, len = sizeof(u32), nthreads = 1;
- intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len);
+ intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
+ &len);
if (intserv)
nthreads = len / sizeof(int);
else {
- intserv = get_property(dn, "reg", NULL);
+ intserv = of_get_property(dn, "reg", NULL);
if (!intserv)
intserv = &cpu; /* assume logical == phys */
}
@@ -383,7 +384,7 @@ void __init smp_setup_cpu_maps(void)
num_addr_cell = of_n_addr_cells(dn);
num_size_cell = of_n_size_cells(dn);
- ireg = get_property(dn, "ibm,lrdr-capacity", NULL);
+ ireg = of_get_property(dn, "ibm,lrdr-capacity", NULL);
if (!ireg)
goto out;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 3733de3..233024a 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -110,7 +110,7 @@ static void check_smt_enabled(void)
dn = of_find_node_by_path("/options");
if (dn) {
- smt_option = get_property(dn, "ibm,smt-enabled", NULL);
+ smt_option = of_get_property(dn, "ibm,smt-enabled", NULL);
if (smt_option) {
if (!strcmp(smt_option, "on"))
@@ -305,10 +305,10 @@ static void __init initialize_cache_info(void)
size = 0;
lsize = cur_cpu_spec->dcache_bsize;
- sizep = get_property(np, "d-cache-size", NULL);
+ sizep = of_get_property(np, "d-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = get_property(np, dc, NULL);
+ lsizep = of_get_property(np, dc, NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
@@ -322,10 +322,10 @@ static void __init initialize_cache_info(void)
size = 0;
lsize = cur_cpu_spec->icache_bsize;
- sizep = get_property(np, "i-cache-size", NULL);
+ sizep = of_get_property(np, "i-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = get_property(np, ic, NULL);
+ lsizep = of_get_property(np, ic, NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index d57818a..476f1d5 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -70,7 +70,7 @@ static int __init smt_setup(void)
if (!options)
return -ENODEV;
- val = get_property(options, "ibm,smt-snooze-delay", NULL);
+ val = of_get_property(options, "ibm,smt-snooze-delay", NULL);
if (!smt_snooze_cmdline && val) {
for_each_possible_cpu(cpu)
per_cpu(smt_snooze_delay, cpu) = *val;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index f6f0c6b..7cedef8 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -834,7 +834,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val)
cpu = of_find_node_by_type(NULL, "cpu");
if (cpu) {
- fp = get_property(cpu, name, NULL);
+ fp = of_get_property(cpu, name, NULL);
if (fp) {
found = 1;
*val = of_read_ulong(fp, cells);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 2968ffe..a09277a 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -81,7 +81,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
struct iommu_table *tbl;
unsigned long offset, size;
- dma_window = get_property(dev->dev.archdata.of_node,
+ dma_window = of_get_property(dev->dev.archdata.of_node,
"ibm,my-dma-window", NULL);
if (!dma_window)
return NULL;
@@ -226,7 +226,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
return NULL;
}
- unit_address = get_property(of_node, "reg", NULL);
+ unit_address = of_get_property(of_node, "reg", NULL);
if (unit_address == NULL) {
printk(KERN_WARNING "%s: node %s missing 'reg'\n",
__FUNCTION__,
@@ -246,7 +246,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
viodev->type = of_node->type;
viodev->unit_address = *unit_address;
if (firmware_has_feature(FW_FEATURE_ISERIES)) {
- unit_address = get_property(of_node,
+ unit_address = of_get_property(of_node,
"linux,unit_address", NULL);
if (unit_address != NULL)
viodev->unit_address = *unit_address;
@@ -377,7 +377,7 @@ static int vio_hotplug(struct device *dev, char **envp, int num_envp,
dn = dev->archdata.of_node;
if (!dn)
return -ENODEV;
- cp = get_property(dn, "compatible", &length);
+ cp = of_get_property(dn, "compatible", &length);
if (!cp)
return -ENODEV;
@@ -406,12 +406,12 @@ struct bus_type vio_bus_type = {
* @which: The property/attribute to be extracted.
* @length: Pointer to length of returned data size (unused if NULL).
*
- * Calls prom.c's get_property() to return the value of the
+ * Calls prom.c's of_get_property() to return the value of the
* attribute specified by @which
*/
const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length)
{
- return get_property(vdev->dev.archdata.of_node, which, length);
+ return of_get_property(vdev->dev.archdata.of_node, which, length);
}
EXPORT_SYMBOL(vio_get_attribute);
@@ -443,7 +443,7 @@ struct vio_dev *vio_find_node(struct device_node *vnode)
char kobj_name[BUS_ID_SIZE];
/* construct the kobject name from the device node */
- unit_address = get_property(vnode, "reg", NULL);
+ unit_address = of_get_property(vnode, "reg", NULL);
if (!unit_address)
return NULL;
snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 03/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/mm
2007-04-03 12:26 ` [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel Stephen Rothwell
@ 2007-04-03 12:28 ` Stephen Rothwell
2007-04-03 12:30 ` [PATCH 04/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/sysdev Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:28 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/mm/hash_native_64.c | 2 +-
arch/powerpc/mm/numa.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 6f1016a..79aedaf 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -505,7 +505,7 @@ static inline int tlb_batching_enabled(void)
int enabled = 1;
if (root) {
- const char *model = get_property(root, "model", NULL);
+ const char *model = of_get_property(root, "model", NULL);
if (model && !strcmp(model, "IBM,9076-N81"))
enabled = 0;
of_node_put(root);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 683839b..b3a592b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -74,7 +74,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) {
/* Try interrupt server first */
- interrupt_server = get_property(cpu_node,
+ interrupt_server = of_get_property(cpu_node,
"ibm,ppc-interrupt-server#s", &len);
len = len / sizeof(u32);
@@ -85,7 +85,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
return cpu_node;
}
} else {
- reg = get_property(cpu_node, "reg", &len);
+ reg = of_get_property(cpu_node, "reg", &len);
if (reg && (len > 0) && (reg[0] == hw_cpuid))
return cpu_node;
}
@@ -97,7 +97,7 @@ static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
/* must hold reference to node during call */
static const int *of_get_associativity(struct device_node *dev)
{
- return get_property(dev, "ibm,associativity", NULL);
+ return of_get_property(dev, "ibm,associativity", NULL);
}
/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
@@ -179,7 +179,7 @@ static int __init find_min_common_depth(void)
* configuration (should be all 0's) and the second is for a normal
* NUMA configuration.
*/
- ref_points = get_property(rtas_root,
+ ref_points = of_get_property(rtas_root,
"ibm,associativity-reference-points", &len);
if ((len >= 1) && ref_points) {
@@ -308,9 +308,9 @@ static void __init parse_drconf_memory(struct device_node *memory)
int nid, default_nid = 0;
unsigned int start, ai, flags;
- lm = get_property(memory, "ibm,lmb-size", &ls);
- dm = get_property(memory, "ibm,dynamic-memory", &ld);
- aa = get_property(memory, "ibm,associativity-lookup-arrays", &la);
+ lm = of_get_property(memory, "ibm,lmb-size", &ls);
+ dm = of_get_property(memory, "ibm,dynamic-memory", &ld);
+ aa = of_get_property(memory, "ibm,associativity-lookup-arrays", &la);
if (!lm || !dm || !aa ||
ls < sizeof(unsigned int) || ld < sizeof(unsigned int) ||
la < 2 * sizeof(unsigned int))
@@ -404,10 +404,10 @@ static int __init parse_numa_properties(void)
const unsigned int *memcell_buf;
unsigned int len;
- memcell_buf = get_property(memory,
+ memcell_buf = of_get_property(memory,
"linux,usable-memory", &len);
if (!memcell_buf || len <= 0)
- memcell_buf = get_property(memory, "reg", &len);
+ memcell_buf = of_get_property(memory, "reg", &len);
if (!memcell_buf || len <= 0)
continue;
@@ -725,7 +725,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
const unsigned int *memcell_buf;
unsigned int len;
- memcell_buf = get_property(memory, "reg", &len);
+ memcell_buf = of_get_property(memory, "reg", &len);
if (!memcell_buf || len <= 0)
continue;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 04/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/sysdev
2007-04-03 12:28 ` [PATCH 03/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/mm Stephen Rothwell
@ 2007-04-03 12:30 ` Stephen Rothwell
2007-04-03 12:31 ` [PATCH 05/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/pseries Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:30 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
arch/powerpc/sysdev/dcr.c | 14 ++--
arch/powerpc/sysdev/fsl_soc.c | 90 ++++++++++++++------------
arch/powerpc/sysdev/mpic.c | 8 +-
arch/powerpc/sysdev/qe_lib/qe.c | 4 +-
arch/powerpc/sysdev/qe_lib/qe_io.c | 6 +-
arch/powerpc/sysdev/tsi108_dev.c | 16 ++--
arch/powerpc/sysdev/tsi108_pci.c | 2 +-
9 files changed, 75 insertions(+), 69 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index ef52ce7..baad9ac 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -247,7 +247,7 @@ void init_smc_ioports(struct fs_uart_platform_info *data)
}
}
-int platform_device_skip(char *model, int id)
+int platform_device_skip(const char *model, int id)
{
return 0;
}
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index c5fefdf..e4dcdfb 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -322,7 +322,7 @@ void init_smc_ioports(struct fs_uart_platform_info *data)
}
}
-int platform_device_skip(char *model, int id)
+int platform_device_skip(const char *model, int id)
{
#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
const char *dev = "FEC";
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index dffeeae..7cca362 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -26,7 +26,7 @@
unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
{
unsigned int ds;
- const u32 *dr = get_property(np, "dcr-reg", &ds);
+ const u32 *dr = of_get_property(np, "dcr-reg", &ds);
if (dr == NULL || ds & 1 || index >= (ds / 8))
return 0;
@@ -37,7 +37,7 @@ unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
{
unsigned int ds;
- const u32 *dr = get_property(np, "dcr-reg", &ds);
+ const u32 *dr = of_get_property(np, "dcr-reg", &ds);
if (dr == NULL || ds & 1 || index >= (ds / 8))
return 0;
@@ -53,9 +53,9 @@ static struct device_node * find_dcr_parent(struct device_node * node)
const u32 *p;
for (par = of_node_get(node); par;) {
- if (get_property(par, "dcr-controller", NULL))
+ if (of_get_property(par, "dcr-controller", NULL))
break;
- p = get_property(par, "dcr-parent", NULL);
+ p = of_get_property(par, "dcr-parent", NULL);
tmp = par;
if (p == NULL)
par = of_get_parent(par);
@@ -80,13 +80,13 @@ u64 of_translate_dcr_address(struct device_node *dev,
return OF_BAD_ADDR;
/* Stride is not properly defined yet, default to 0x10 for Axon */
- p = get_property(dp, "dcr-mmio-stride", NULL);
+ p = of_get_property(dp, "dcr-mmio-stride", NULL);
stride = (p == NULL) ? 0x10 : *p;
/* XXX FIXME: Which property name is to use of the 2 following ? */
- p = get_property(dp, "dcr-mmio-range", NULL);
+ p = of_get_property(dp, "dcr-mmio-range", NULL);
if (p == NULL)
- p = get_property(dp, "dcr-mmio-space", NULL);
+ p = of_get_property(dp, "dcr-mmio-space", NULL);
if (p == NULL)
return OF_BAD_ADDR;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index d20f029..8a123c7 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -52,7 +52,7 @@ phys_addr_t get_immrbase(void)
soc = of_find_node_by_type(NULL, "soc");
if (soc) {
unsigned int size;
- const void *prop = get_property(soc, "reg", &size);
+ const void *prop = of_get_property(soc, "reg", &size);
if (prop)
immrbase = of_translate_address(soc, prop);
@@ -78,8 +78,8 @@ u32 get_brgfreq(void)
node = of_find_node_by_type(NULL, "cpm");
if (node) {
unsigned int size;
- const unsigned int *prop = get_property(node, "brg-frequency",
- &size);
+ const unsigned int *prop = of_get_property(node,
+ "brg-frequency", &size);
if (prop)
brgfreq = *prop;
@@ -103,8 +103,8 @@ u32 get_baudrate(void)
node = of_find_node_by_type(NULL, "serial");
if (node) {
unsigned int size;
- const unsigned int *prop = get_property(node, "current-speed",
- &size);
+ const unsigned int *prop = of_get_property(node,
+ "current-speed", &size);
if (prop)
fs_baudrate = *prop;
@@ -153,7 +153,8 @@ static int __init gfar_mdio_of_init(void)
while ((child = of_get_next_child(np, child)) != NULL) {
int irq = irq_of_parse_and_map(child, 0);
if (irq != NO_IRQ) {
- const u32 *id = get_property(child, "reg", NULL);
+ const u32 *id = of_get_property(child,
+ "reg", NULL);
mdio_data.irq[*id] = irq;
}
}
@@ -209,7 +210,7 @@ static int __init gfar_of_init(void)
of_irq_to_resource(np, 0, &r[1]);
- model = get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
/* If we aren't the FEC we have multiple interrupts */
if (model && strcasecmp(model, "FEC")) {
@@ -253,7 +254,7 @@ static int __init gfar_of_init(void)
FSL_GIANFAR_DEV_HAS_VLAN |
FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
- ph = get_property(np, "phy-handle", NULL);
+ ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL) {
@@ -263,7 +264,7 @@ static int __init gfar_of_init(void)
mdio = of_get_parent(phy);
- id = get_property(phy, "reg", NULL);
+ id = of_get_property(phy, "reg", NULL);
ret = of_address_to_resource(mdio, 0, &res);
if (ret) {
of_node_put(phy);
@@ -325,11 +326,11 @@ static int __init fsl_i2c_of_init(void)
}
i2c_data.device_flags = 0;
- flags = get_property(np, "dfsrr", NULL);
+ flags = of_get_property(np, "dfsrr", NULL);
if (flags)
i2c_data.device_flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
- flags = get_property(np, "fsl5200-clocking", NULL);
+ flags = of_get_property(np, "fsl5200-clocking", NULL);
if (flags)
i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200;
@@ -374,7 +375,7 @@ static int __init mpc83xx_wdt_init(void)
goto nosoc;
}
- freq = get_property(soc, "bus-frequency", NULL);
+ freq = of_get_property(soc, "bus-frequency", NULL);
if (!freq) {
ret = -ENODEV;
goto err;
@@ -466,15 +467,15 @@ static int __init fsl_usb_of_init(void)
usb_data.operating_mode = FSL_USB2_MPH_HOST;
- prop = get_property(np, "port0", NULL);
+ prop = of_get_property(np, "port0", NULL);
if (prop)
usb_data.port_enables |= FSL_USB2_PORT0_ENABLED;
- prop = get_property(np, "port1", NULL);
+ prop = of_get_property(np, "port1", NULL);
if (prop)
usb_data.port_enables |= FSL_USB2_PORT1_ENABLED;
- prop = get_property(np, "phy_type", NULL);
+ prop = of_get_property(np, "phy_type", NULL);
usb_data.phy_mode = determine_usb_phy(prop);
ret =
@@ -501,7 +502,7 @@ static int __init fsl_usb_of_init(void)
of_irq_to_resource(np, 0, &r[1]);
- prop = get_property(np, "dr_mode", NULL);
+ prop = of_get_property(np, "dr_mode", NULL);
if (!prop || !strcmp(prop, "host")) {
usb_data.operating_mode = FSL_USB2_DR_HOST;
@@ -538,7 +539,7 @@ static int __init fsl_usb_of_init(void)
goto err;
}
- prop = get_property(np, "phy_type", NULL);
+ prop = of_get_property(np, "phy_type", NULL);
usb_data.phy_mode = determine_usb_phy(prop);
if (usb_dev_dr_host) {
@@ -633,7 +634,7 @@ static int __init fs_enet_of_init(void)
goto err;
}
- model = get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
if (model == NULL) {
ret = -ENODEV;
goto unreg;
@@ -643,7 +644,7 @@ static int __init fs_enet_of_init(void)
if (mac_addr)
memcpy(fs_enet_data.macaddr, mac_addr, 6);
- ph = get_property(np, "phy-handle", NULL);
+ ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL) {
@@ -651,12 +652,12 @@ static int __init fs_enet_of_init(void)
goto unreg;
}
- phy_addr = get_property(phy, "reg", NULL);
+ phy_addr = of_get_property(phy, "reg", NULL);
fs_enet_data.phy_addr = *phy_addr;
- phy_irq = get_property(phy, "interrupts", NULL);
+ phy_irq = of_get_property(phy, "interrupts", NULL);
- id = get_property(np, "device-id", NULL);
+ id = of_get_property(np, "device-id", NULL);
fs_enet_data.fs_no = *id;
strcpy(fs_enet_data.fs_type, model);
@@ -668,8 +669,10 @@ static int __init fs_enet_of_init(void)
goto unreg;
}
- fs_enet_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL));
- fs_enet_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL));
+ fs_enet_data.clk_rx = *((u32 *)of_get_property(np,
+ "rx-clock", NULL));
+ fs_enet_data.clk_tx = *((u32 *)of_get_property(np,
+ "tx-clock", NULL));
if (strstr(model, "FCC")) {
int fcc_index = *id - 1;
@@ -690,7 +693,7 @@ static int __init fs_enet_of_init(void)
fs_enet_data.bus_id = (char*)&bus_id[(*id)];
fs_enet_data.init_ioports = init_fcc_ioports;
- mdio_bb_prop = get_property(phy, "bitbang", NULL);
+ mdio_bb_prop = of_get_property(phy, "bitbang", NULL);
if (mdio_bb_prop) {
struct platform_device *fs_enet_mdio_bb_dev;
struct fs_mii_bb_platform_info fs_enet_mdio_bb_data;
@@ -796,10 +799,10 @@ static int __init cpm_uart_of_init(void)
goto err;
}
- id = get_property(np, "device-id", NULL);
+ id = of_get_property(np, "device-id", NULL);
cpm_uart_data.fs_no = *id;
- model = (char*)get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
strcpy(cpm_uart_data.fs_type, model);
cpm_uart_data.uart_clk = ppc_proc_freq;
@@ -808,8 +811,10 @@ static int __init cpm_uart_of_init(void)
cpm_uart_data.tx_buf_size = 32;
cpm_uart_data.rx_num_fifo = 4;
cpm_uart_data.rx_buf_size = 32;
- cpm_uart_data.clk_rx = *((u32 *) get_property(np, "rx-clock", NULL));
- cpm_uart_data.clk_tx = *((u32 *) get_property(np, "tx-clock", NULL));
+ cpm_uart_data.clk_rx = *((u32 *)of_get_property(np,
+ "rx-clock", NULL));
+ cpm_uart_data.clk_tx = *((u32 *)of_get_property(np,
+ "tx-clock", NULL));
ret =
platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
@@ -833,7 +838,7 @@ arch_initcall(cpm_uart_of_init);
#ifdef CONFIG_8xx
extern void init_scc_ioports(struct fs_platform_info*);
-extern int platform_device_skip(char *model, int id);
+extern int platform_device_skip(const char *model, int id);
static int __init fs_enet_mdio_of_init(void)
{
@@ -900,21 +905,22 @@ static int __init fs_enet_of_init(void)
struct resource r[4];
struct device_node *phy = NULL, *mdio = NULL;
struct fs_platform_info fs_enet_data;
- unsigned int *id, *phy_addr;
+ const unsigned int *id;
+ const unsigned int *phy_addr;
void *mac_addr;
- phandle *ph;
- char *model;
+ const phandle *ph;
+ const char *model;
memset(r, 0, sizeof(r));
memset(&fs_enet_data, 0, sizeof(fs_enet_data));
- model = (char *)get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
if (model == NULL) {
ret = -ENODEV;
goto unreg;
}
- id = (u32 *) get_property(np, "device-id", NULL);
+ id = of_get_property(np, "device-id", NULL);
fs_enet_data.fs_no = *id;
if (platform_device_skip(model, *id))
@@ -929,12 +935,12 @@ static int __init fs_enet_of_init(void)
if (mac_addr)
memcpy(fs_enet_data.macaddr, mac_addr, 6);
- ph = (phandle *) get_property(np, "phy-handle", NULL);
+ ph = of_get_property(np, "phy-handle", NULL);
if (ph != NULL)
phy = of_find_node_by_phandle(*ph);
if (phy != NULL) {
- phy_addr = (u32 *) get_property(phy, "reg", NULL);
+ phy_addr = of_get_property(phy, "reg", NULL);
fs_enet_data.phy_addr = *phy_addr;
fs_enet_data.has_phy = 1;
@@ -947,7 +953,7 @@ static int __init fs_enet_of_init(void)
}
}
- model = (char*)get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
strcpy(fs_enet_data.fs_type, model);
if (strstr(model, "FEC")) {
@@ -1038,8 +1044,8 @@ static int __init cpm_smc_uart_of_init(void)
i++) {
struct resource r[3];
struct fs_uart_platform_info cpm_uart_data;
- int *id;
- char *model;
+ const int *id;
+ const char *model;
memset(r, 0, sizeof(r));
memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
@@ -1066,10 +1072,10 @@ static int __init cpm_smc_uart_of_init(void)
goto err;
}
- model = (char*)get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
strcpy(cpm_uart_data.fs_type, model);
- id = (int*)get_property(np, "device-id", NULL);
+ id = of_get_property(np, "device-id", NULL);
cpm_uart_data.fs_no = *id;
cpm_uart_data.uart_clk = ppc_proc_freq;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index bcfb900..27e6f78 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -970,7 +970,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
mpic->spurious_vec = intvec_top;
/* Check for "big-endian" in device-tree */
- if (node && get_property(node, "big-endian", NULL) != NULL)
+ if (node && of_get_property(node, "big-endian", NULL) != NULL)
mpic->flags |= MPIC_BIG_ENDIAN;
@@ -986,13 +986,13 @@ struct mpic * __init mpic_alloc(struct device_node *node,
BUG_ON(paddr == 0 && node == NULL);
/* If no physical address passed in, check if it's dcr based */
- if (paddr == 0 && get_property(node, "dcr-reg", NULL) != NULL)
+ if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL)
mpic->flags |= MPIC_USES_DCR;
#ifdef CONFIG_PPC_DCR
if (mpic->flags & MPIC_USES_DCR) {
const u32 *dbasep;
- dbasep = get_property(node, "dcr-reg", NULL);
+ dbasep = of_get_property(node, "dcr-reg", NULL);
BUG_ON(dbasep == NULL);
mpic->dcr_base = *dbasep;
mpic->reg_type = mpic_access_dcr;
@@ -1006,7 +1006,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
*/
if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
const u32 *reg;
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
BUG_ON(reg == NULL);
paddr = of_translate_address(node, reg);
BUG_ON(paddr == OF_BAD_ADDR);
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index e3d71e0..0558b1c 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -71,7 +71,7 @@ phys_addr_t get_qe_base(void)
qe = of_find_node_by_type(NULL, "qe");
if (qe) {
unsigned int size;
- const void *prop = get_property(qe, "reg", &size);
+ const void *prop = of_get_property(qe, "reg", &size);
qebase = of_translate_address(qe, prop);
of_node_put(qe);
};
@@ -158,7 +158,7 @@ unsigned int get_brg_clk(void)
qe = of_find_node_by_type(NULL, "qe");
if (qe) {
unsigned int size;
- const u32 *prop = get_property(qe, "brg-frequency", &size);
+ const u32 *prop = of_get_property(qe, "brg-frequency", &size);
brg_clk = *prop;
of_node_put(qe);
};
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c
index 0afe6bf..e32b45b 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -53,7 +53,7 @@ int par_io_init(struct device_node *np)
return ret;
par_io = ioremap(res.start, res.end - res.start + 1);
- num_ports = get_property(np, "num-ports", NULL);
+ num_ports = of_get_property(np, "num-ports", NULL);
if (num_ports)
num_par_io_ports = *num_ports;
@@ -161,7 +161,7 @@ int par_io_of_config(struct device_node *np)
return -1;
}
- ph = get_property(np, "pio-handle", NULL);
+ ph = of_get_property(np, "pio-handle", NULL);
if (ph == 0) {
printk(KERN_ERR "pio-handle not available \n");
return -1;
@@ -169,7 +169,7 @@ int par_io_of_config(struct device_node *np)
pio = of_find_node_by_phandle(*ph);
- pio_map = get_property(pio, "pio-map", &pio_map_len);
+ pio_map = of_get_property(pio, "pio-map", &pio_map_len);
if (pio_map == NULL) {
printk(KERN_ERR "pio-map is not set! \n");
return -1;
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 97f37ef..337039e 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -48,7 +48,7 @@ phys_addr_t get_csrbase(void)
tsi = of_find_node_by_type(NULL, "tsi-bridge");
if (tsi) {
unsigned int size;
- const void *prop = get_property(tsi, "reg", &size);
+ const void *prop = of_get_property(tsi, "reg", &size);
tsi108_csr_base = of_translate_address(tsi, prop);
of_node_put(tsi);
};
@@ -77,10 +77,10 @@ static int __init tsi108_eth_of_init(void)
struct resource r[2];
struct device_node *phy;
hw_info tsi_eth_data;
- unsigned int *id;
- unsigned int *phy_id;
+ const unsigned int *id;
+ const unsigned int *phy_id;
const void *mac_addr;
- phandle *ph;
+ const phandle *ph;
memset(r, 0, sizeof(r));
memset(&tsi_eth_data, 0, sizeof(tsi_eth_data));
@@ -107,10 +107,10 @@ static int __init tsi108_eth_of_init(void)
goto err;
}
- mac_addr = get_property(np, "address", NULL);
+ mac_addr = of_get_property(np, "address", NULL);
memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
- ph = (phandle *) get_property(np, "phy-handle", NULL);
+ ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL) {
@@ -118,8 +118,8 @@ static int __init tsi108_eth_of_init(void)
goto unreg;
}
- id = (u32 *) get_property(phy, "reg", NULL);
- phy_id = (u32 *) get_property(phy, "phy-id", NULL);
+ id = of_get_property(phy, "reg", NULL);
+ phy_id = of_get_property(phy, "phy-id", NULL);
ret = of_address_to_resource(phy, 0, &res);
if (ret) {
of_node_put(phy);
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index ae249c6..58b9e7f 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -211,7 +211,7 @@ int __init tsi108_setup_pci(struct device_node *dev)
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
/* Get bus range if any */
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 05/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/pseries
2007-04-03 12:30 ` [PATCH 04/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/sysdev Stephen Rothwell
@ 2007-04-03 12:31 ` Stephen Rothwell
2007-04-03 12:32 ` [PATCH 06/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/powermac Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:31 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/pseries/eeh.c | 10 +++++-----
arch/powerpc/platforms/pseries/eeh_driver.c | 4 ++--
arch/powerpc/platforms/pseries/eeh_event.c | 2 +-
arch/powerpc/platforms/pseries/firmware.c | 2 +-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 4 ++--
arch/powerpc/platforms/pseries/iommu.c | 12 ++++++------
arch/powerpc/platforms/pseries/lpar.c | 6 +++---
arch/powerpc/platforms/pseries/nvram.c | 2 +-
arch/powerpc/platforms/pseries/pci.c | 2 +-
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/platforms/pseries/rtasd.c | 2 +-
arch/powerpc/platforms/pseries/setup.c | 8 ++++----
arch/powerpc/platforms/pseries/xics.c | 15 ++++++++-------
13 files changed, 36 insertions(+), 35 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index a56be71..48fbd44 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -789,10 +789,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
unsigned int rets[3];
struct eeh_early_enable_info *info = data;
int ret;
- const char *status = get_property(dn, "status", NULL);
- const u32 *class_code = get_property(dn, "class-code", NULL);
- const u32 *vendor_id = get_property(dn, "vendor-id", NULL);
- const u32 *device_id = get_property(dn, "device-id", NULL);
+ const char *status = of_get_property(dn, "status", NULL);
+ const u32 *class_code = of_get_property(dn, "class-code", NULL);
+ const u32 *vendor_id = of_get_property(dn, "vendor-id", NULL);
+ const u32 *device_id = of_get_property(dn, "device-id", NULL);
const u32 *regs;
int enable;
struct pci_dn *pdn = PCI_DN(dn);
@@ -835,7 +835,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
/* Ok... see if this device supports EEH. Some do, some don't,
* and the only way to find out is to check each and every one. */
- regs = get_property(dn, "reg", NULL);
+ regs = of_get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
/* Try to enable eeh */
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index 8cc331e..3170e00 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -314,14 +314,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
if (!frozen_dn) {
- location = get_property(event->dn, "ibm,loc-code", NULL);
+ location = of_get_property(event->dn, "ibm,loc-code", NULL);
location = location ? location : "unknown";
printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
"for location=%s pci addr=%s\n",
location, pci_name(event->dev));
return NULL;
}
- location = get_property(frozen_dn, "ibm,loc-code", NULL);
+ location = of_get_property(frozen_dn, "ibm,loc-code", NULL);
location = location ? location : "unknown";
/* There are two different styles for coming up with the PE.
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index 221dec8..ddb80f5 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -126,7 +126,7 @@ int eeh_send_failure_event (struct device_node *dn,
if (!mem_init_done) {
printk(KERN_ERR "EEH: event during early boot not handled\n");
- location = get_property(dn, "ibm,loc-code", NULL);
+ location = of_get_property(dn, "ibm,loc-code", NULL);
printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
printk(KERN_ERR "EEH: PCI location = %s\n", location);
return 1;
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index 90522e3..29bf83b 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -80,7 +80,7 @@ void __init fw_feature_init(void)
goto out;
}
- hypertas = get_property(dn, "ibm,hypertas-functions", &len);
+ hypertas = of_get_property(dn, "ibm,hypertas-functions", &len);
if (hypertas == NULL)
goto out;
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index f460b9c..9711eb0 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -143,7 +143,7 @@ static int pseries_add_processor(struct device_node *np)
int err = -ENOSPC, len, nthreads, i;
const u32 *intserv;
- intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len);
+ intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len);
if (!intserv)
return 0;
@@ -203,7 +203,7 @@ static void pseries_remove_processor(struct device_node *np)
int len, nthreads, i;
const u32 *intserv;
- intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len);
+ intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len);
if (!intserv)
return;
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index f9510a5..66665c8 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -253,8 +253,8 @@ static void iommu_table_setparms(struct pci_controller *phb,
node = (struct device_node *)phb->arch_data;
- basep = get_property(node, "linux,tce-base", NULL);
- sizep = get_property(node, "linux,tce-size", NULL);
+ basep = of_get_property(node, "linux,tce-base", NULL);
+ sizep = of_get_property(node, "linux,tce-size", NULL);
if (basep == NULL || sizep == NULL) {
printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has "
"missing tce entries !\n", dn->full_name);
@@ -404,7 +404,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
/* Find nearest ibm,dma-window, walking up the device tree */
for (pdn = dn; pdn != NULL; pdn = pdn->parent) {
- dma_window = get_property(pdn, "ibm,dma-window", NULL);
+ dma_window = of_get_property(pdn, "ibm,dma-window", NULL);
if (dma_window != NULL)
break;
}
@@ -499,7 +499,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
pdn = pdn->parent) {
- dma_window = get_property(pdn, "ibm,dma-window", NULL);
+ dma_window = of_get_property(pdn, "ibm,dma-window", NULL);
if (dma_window)
break;
}
@@ -548,7 +548,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
switch (action) {
case PSERIES_RECONFIG_REMOVE:
if (pci && pci->iommu_table &&
- get_property(np, "ibm,dma-window", NULL))
+ of_get_property(np, "ibm,dma-window", NULL))
iommu_free_table(np);
break;
default:
@@ -565,7 +565,7 @@ static struct notifier_block iommu_reconfig_nb = {
/* These are called very early. */
void iommu_init_early_pSeries(void)
{
- if (of_chosen && get_property(of_chosen, "linux,iommu-off", NULL)) {
+ if (of_chosen && of_get_property(of_chosen, "linux,iommu-off", NULL)) {
/* Direct I/O, IOMMU off */
ppc_md.pci_dma_dev_setup = NULL;
ppc_md.pci_dma_bus_setup = NULL;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 843ee96..3a70e8a 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -209,13 +209,13 @@ void __init find_udbg_vterm(void)
/* find the boot console from /chosen/stdout */
if (!of_chosen)
return;
- name = get_property(of_chosen, "linux,stdout-path", NULL);
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (name == NULL)
return;
stdout_node = of_find_node_by_path(name);
if (!stdout_node)
return;
- name = get_property(stdout_node, "name", NULL);
+ name = of_get_property(stdout_node, "name", NULL);
if (!name) {
printk(KERN_WARNING "stdout node missing 'name' property!\n");
goto out;
@@ -226,7 +226,7 @@ void __init find_udbg_vterm(void)
/* Check if it's a virtual terminal */
if (strncmp(name, "vty", 3) != 0)
goto out;
- termno = get_property(stdout_node, "reg", NULL);
+ termno = of_get_property(stdout_node, "reg", NULL);
if (termno == NULL)
goto out;
vtermno = termno[0];
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 64163ce..f68903e 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -130,7 +130,7 @@ int __init pSeries_nvram_init(void)
if (nvram == NULL)
return -ENODEV;
- nbytes_p = get_property(nvram, "#bytes", &proplen);
+ nbytes_p = of_get_property(nvram, "#bytes", &proplen);
if (nbytes_p == NULL || proplen != sizeof(unsigned int))
return -EIO;
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index fa59124..ccaaa98 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -39,7 +39,7 @@ void pcibios_name_device(struct pci_dev *dev)
*/
dn = pci_device_to_OF_node(dev);
if (dn) {
- char *loc_code = get_property(dn, "ibm,loc-code", 0);
+ const char *loc_code = of_get_property(dn, "ibm,loc-code", 0);
if (loc_code) {
int loc_len = strlen(loc_code);
if (loc_len < sizeof(dev->dev.name)) {
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index edc0388..53aa041 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -85,7 +85,7 @@ static void request_ras_irqs(struct device_node *np,
* map those interrupts using the default interrupt host and default
* trigger
*/
- opicprop = get_property(np, "open-pic-interrupt", &opicplen);
+ opicprop = of_get_property(np, "open-pic-interrupt", &opicplen);
if (opicprop) {
opicplen /= sizeof(u32);
for (i = 0; i < opicplen; i++) {
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index 77d0937..9797b10 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -363,7 +363,7 @@ static int get_eventscan_parms(void)
node = of_find_node_by_path("/rtas");
- ip = get_property(node, "rtas-event-scan-rate", NULL);
+ ip = of_get_property(node, "rtas-event-scan-rate", NULL);
if (ip == NULL) {
printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
of_node_put(node);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 54e93eb..e2fcd23 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -93,7 +93,7 @@ static void pSeries_show_cpuinfo(struct seq_file *m)
root = of_find_node_by_path("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
seq_printf(m, "machine\t\t: CHRP %s\n", model);
of_node_put(root);
}
@@ -140,7 +140,7 @@ static void __init pseries_mpic_init_IRQ(void)
np = of_find_node_by_path("/");
naddr = of_n_addr_cells(np);
- opprop = get_property(np, "platform-open-pic", &opplen);
+ opprop = of_get_property(np, "platform-open-pic", &opplen);
if (opprop != 0) {
openpic_addr = of_read_number(opprop, naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
@@ -189,7 +189,7 @@ static void __init pseries_mpic_init_IRQ(void)
break;
if (strcmp(np->name, "pci") != 0)
continue;
- addrp = get_property(np, "8259-interrupt-acknowledge",
+ addrp = of_get_property(np, "8259-interrupt-acknowledge",
NULL);
if (addrp == NULL)
continue;
@@ -226,7 +226,7 @@ static void __init pseries_discover_pic(void)
for (np = NULL; (np = of_find_node_by_name(np,
"interrupt-controller"));) {
- typep = get_property(np, "compatible", NULL);
+ typep = of_get_property(np, "compatible", NULL);
if (strstr(typep, "open-pic")) {
pSeries_mpic_node = of_node_get(np);
ppc_md.init_IRQ = pseries_mpic_init_IRQ;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f0795fa..896cbf3 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -576,7 +576,7 @@ static void __init xics_init_one_node(struct device_node *np,
* This happens to be the case so far but we are playing with fire...
* should be fixed one of these days. -BenH.
*/
- ireg = get_property(np, "ibm,interrupt-server-ranges", NULL);
+ ireg = of_get_property(np, "ibm,interrupt-server-ranges", NULL);
/* Do that ever happen ? we'll know soon enough... but even good'old
* f80 does have that property ..
@@ -588,7 +588,7 @@ static void __init xics_init_one_node(struct device_node *np,
*/
*indx = *ireg;
}
- ireg = get_property(np, "reg", &ilen);
+ ireg = of_get_property(np, "reg", &ilen);
if (!ireg)
panic("xics_init_IRQ: can't find interrupt reg property");
@@ -640,7 +640,7 @@ static void __init xics_setup_8259_cascade(void)
break;
if (strcmp(np->name, "pci") != 0)
continue;
- addrp = get_property(np, "8259-interrupt-acknowledge", NULL);
+ addrp = of_get_property(np, "8259-interrupt-acknowledge", NULL);
if (addrp == NULL)
continue;
naddr = of_n_addr_cells(np);
@@ -664,10 +664,11 @@ static struct device_node *cpuid_to_of_node(int cpu)
int i, len;
const u32 *intserv;
- intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len);
+ intserv = of_get_property(np, "ibm,ppc-interrupt-server#s",
+ &len);
if (!intserv)
- intserv = get_property(np, "reg", &len);
+ intserv = of_get_property(np, "reg", &len);
i = len / sizeof(u32);
@@ -709,7 +710,7 @@ void __init xics_init_IRQ(void)
/* Find the server numbers for the boot cpu. */
np = cpuid_to_of_node(boot_cpuid);
BUG_ON(!np);
- ireg = get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen);
+ ireg = of_get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen);
if (!ireg)
goto skip_gserver_check;
i = ilen / sizeof(int);
@@ -725,7 +726,7 @@ void __init xics_init_IRQ(void)
default_server = hcpuid;
default_distrib_server = ireg[j+1];
- isize = get_property(np,
+ isize = of_get_property(np,
"ibm,interrupt-server#-size", NULL);
if (isize)
interrupt_server_size = *isize;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 06/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/powermac
2007-04-03 12:31 ` [PATCH 05/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/pseries Stephen Rothwell
@ 2007-04-03 12:32 ` Stephen Rothwell
2007-04-03 12:35 ` [PATCH 07/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/cell Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:32 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/powermac/backlight.c | 2 +-
arch/powerpc/platforms/powermac/cpufreq_32.c | 21 +++++++++++----------
arch/powerpc/platforms/powermac/cpufreq_64.c | 16 ++++++++--------
arch/powerpc/platforms/powermac/feature.c | 24 ++++++++++++------------
arch/powerpc/platforms/powermac/low_i2c.c | 15 ++++++++-------
arch/powerpc/platforms/powermac/pci.c | 16 ++++++++--------
arch/powerpc/platforms/powermac/pfunc_base.c | 2 +-
arch/powerpc/platforms/powermac/pfunc_core.c | 2 +-
arch/powerpc/platforms/powermac/pic.c | 6 +++---
arch/powerpc/platforms/powermac/setup.c | 20 +++++++++++---------
arch/powerpc/platforms/powermac/smp.c | 6 +++---
arch/powerpc/platforms/powermac/udbg_scc.c | 6 +++---
12 files changed, 70 insertions(+), 66 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index de7440e..0dc8a45 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -59,7 +59,7 @@ int pmac_has_backlight_type(const char *type)
struct device_node* bk_node = find_devices("backlight");
if (bk_node) {
- const char *prop = get_property(bk_node,
+ const char *prop = of_get_property(bk_node,
"backlight-control", NULL);
if (prop && strncmp(prop, type, strlen(type)) == 0)
return 1;
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c2b6b41..76eda9f 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -421,7 +421,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
static u32 read_gpio(struct device_node *np)
{
- const u32 *reg = get_property(np, "reg", NULL);
+ const u32 *reg = of_get_property(np, "reg", NULL);
u32 offset;
if (reg == NULL)
@@ -521,13 +521,14 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
int lenp, rc;
const u32 *freqs, *ratio;
- freqs = get_property(cpunode, "bus-frequencies", &lenp);
+ freqs = of_get_property(cpunode, "bus-frequencies", &lenp);
lenp /= sizeof(u32);
if (freqs == NULL || lenp != 2) {
printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
return 1;
}
- ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL);
+ ratio = of_get_property(cpunode, "processor-to-bus-ratio*2",
+ NULL);
if (ratio == NULL) {
printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
return 1;
@@ -562,7 +563,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
/* If we use the PMU, look for the min & max frequencies in the
* device-tree
*/
- value = get_property(cpunode, "min-clock-frequency", NULL);
+ value = of_get_property(cpunode, "min-clock-frequency", NULL);
if (!value)
return 1;
low_freq = (*value) / 1000;
@@ -571,7 +572,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
if (low_freq < 100000)
low_freq *= 10;
- value = get_property(cpunode, "max-clock-frequency", NULL);
+ value = of_get_property(cpunode, "max-clock-frequency", NULL);
if (!value)
return 1;
hi_freq = (*value) / 1000;
@@ -585,7 +586,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
{
struct device_node *volt_gpio_np;
- if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
+ if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL)
return 1;
volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
@@ -614,11 +615,11 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
u32 pvr;
const u32 *value;
- if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
+ if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL)
return 1;
hi_freq = cur_freq;
- value = get_property(cpunode, "reduced-clock-frequency", NULL);
+ value = of_get_property(cpunode, "reduced-clock-frequency", NULL);
if (!value)
return 1;
low_freq = (*value) / 1000;
@@ -662,14 +663,14 @@ static int __init pmac_cpufreq_setup(void)
goto out;
/* Get current cpu clock freq */
- value = get_property(cpunode, "clock-frequency", NULL);
+ value = of_get_property(cpunode, "clock-frequency", NULL);
if (!value)
goto out;
cur_freq = (*value) / 1000;
/* Check for 7447A based MacRISC3 */
if (machine_is_compatible("MacRISC3") &&
- get_property(cpunode, "dynamic-power-step", NULL) &&
+ of_get_property(cpunode, "dynamic-power-step", NULL) &&
PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {
pmac_cpufreq_init_7447A(cpunode);
/* Check for other MacRISC3 machines */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 9d22361..567d552 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -410,7 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
/* Get first CPU node */
for (cpunode = NULL;
(cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
- const u32 *reg = get_property(cpunode, "reg", NULL);
+ const u32 *reg = of_get_property(cpunode, "reg", NULL);
if (reg == NULL || (*reg) != 0)
continue;
if (!strcmp(cpunode->type, "cpu"))
@@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
}
/* Check 970FX for now */
- valp = get_property(cpunode, "cpu-version", NULL);
+ valp = of_get_property(cpunode, "cpu-version", NULL);
if (!valp) {
DBG("No cpu-version property !\n");
goto bail_noprops;
@@ -434,7 +434,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
}
/* Look for the powertune data in the device-tree */
- g5_pmode_data = get_property(cpunode, "power-mode-data",&psize);
+ g5_pmode_data = of_get_property(cpunode, "power-mode-data",&psize);
if (!g5_pmode_data) {
DBG("No power-mode-data !\n");
goto bail_noprops;
@@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
* half freq in this version. So far, I haven't yet seen a machine
* supporting anything else.
*/
- valp = get_property(cpunode, "clock-frequency", NULL);
+ valp = of_get_property(cpunode, "clock-frequency", NULL);
if (!valp)
return -ENODEV;
max_freq = (*valp)/1000;
@@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
/* Lookup the cpuid eeprom node */
cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0");
if (cpuid != NULL)
- eeprom = get_property(cpuid, "cpuid", NULL);
+ eeprom = of_get_property(cpuid, "cpuid", NULL);
if (eeprom == NULL) {
printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n");
rc = -ENODEV;
@@ -573,13 +573,13 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
/* Lookup the i2c hwclock */
for (hwclock = NULL;
(hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){
- const char *loc = get_property(hwclock,
+ const char *loc = of_get_property(hwclock,
"hwctrl-location", NULL);
if (loc == NULL)
continue;
if (strcmp(loc, "CPU CLOCK"))
continue;
- if (!get_property(hwclock, "platform-get-frequency", NULL))
+ if (!of_get_property(hwclock, "platform-get-frequency", NULL))
continue;
break;
}
@@ -638,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
*/
/* Get max frequency from device-tree */
- valp = get_property(cpunode, "clock-frequency", NULL);
+ valp = of_get_property(cpunode, "clock-frequency", NULL);
if (!valp) {
printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n");
rc = -ENODEV;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 24cc50c..103fcc4 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1057,8 +1057,8 @@ core99_reset_cpu(struct device_node *node, long param, long value)
if (np == NULL)
return -ENODEV;
for (np = np->child; np != NULL; np = np->sibling) {
- const u32 *num = get_property(np, "reg", NULL);
- const u32 *rst = get_property(np, "soft-reset", NULL);
+ const u32 *num = of_get_property(np, "reg", NULL);
+ const u32 *rst = of_get_property(np, "soft-reset", NULL);
if (num == NULL || rst == NULL)
continue;
if (param == *num) {
@@ -1095,7 +1095,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
macio->type != macio_intrepid)
return -ENODEV;
- prop = get_property(node, "AAPL,clock-id", NULL);
+ prop = of_get_property(node, "AAPL,clock-id", NULL);
if (!prop)
return -ENODEV;
if (strncmp(prop, "usb0u048", 8) == 0)
@@ -1506,8 +1506,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
if (np == NULL)
return -ENODEV;
for (np = np->child; np != NULL; np = np->sibling) {
- const u32 *num = get_property(np, "reg", NULL);
- const u32 *rst = get_property(np, "soft-reset", NULL);
+ const u32 *num = of_get_property(np, "reg", NULL);
+ const u32 *rst = of_get_property(np, "soft-reset", NULL);
if (num == NULL || rst == NULL)
continue;
if (param == *num) {
@@ -2411,7 +2411,7 @@ static int __init probe_motherboard(void)
*/
dt = find_devices("device-tree");
if (dt != NULL)
- model = get_property(dt, "model", NULL);
+ model = of_get_property(dt, "model", NULL);
for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
pmac_mb = pmac_mb_defs[i];
@@ -2509,7 +2509,7 @@ found:
if (np->sibling)
break;
/* Nap mode not supported if flush-on-lock property is present */
- if (get_property(np, "flush-on-lock", NULL))
+ if (of_get_property(np, "flush-on-lock", NULL))
break;
powersave_nap = 1;
printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n");
@@ -2558,7 +2558,7 @@ static void __init probe_uninorth(void)
if (uninorth_node == NULL)
return;
- addrp = get_property(uninorth_node, "reg", NULL);
+ addrp = of_get_property(uninorth_node, "reg", NULL);
if (addrp == NULL)
return;
address = of_translate_address(uninorth_node, addrp);
@@ -2642,7 +2642,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
return;
}
if (type == macio_keylargo || type == macio_keylargo2) {
- const u32 *did = get_property(node, "device-id", NULL);
+ const u32 *did = of_get_property(node, "device-id", NULL);
if (*did == 0x00000025)
type = macio_pangea;
if (*did == 0x0000003e)
@@ -2655,7 +2655,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
macio_chips[i].base = base;
macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
macio_chips[i].name = macio_names[type];
- revp = get_property(node, "revision-id", NULL);
+ revp = of_get_property(node, "revision-id", NULL);
if (revp)
macio_chips[i].rev = *revp;
printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
@@ -2706,8 +2706,8 @@ initial_serial_shutdown(struct device_node *np)
int port_type = PMAC_SCC_ASYNC;
int modem = 0;
- slots = get_property(np, "slot-names", &len);
- conn = get_property(np, "AAPL,connector", &len);
+ slots = of_get_property(np, "slot-names", &len);
+ conn = of_get_property(np, "AAPL,connector", &len);
if (conn && (strcmp(conn, "infrared") == 0))
port_type = PMAC_SCC_IRDA;
else if (device_is_compatible(np, "cobalt"))
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index bfc4829..5430e14 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -491,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
* on all i2c keywest nodes so far ... we would have to fallback
* to macio parsing if that wasn't the case
*/
- addrp = get_property(np, "AAPL,address", NULL);
+ addrp = of_get_property(np, "AAPL,address", NULL);
if (addrp == NULL) {
printk(KERN_ERR "low_i2c: Can't find address for %s\n",
np->full_name);
@@ -505,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
host->timeout_timer.function = kw_i2c_timeout;
host->timeout_timer.data = (unsigned long)host;
- psteps = get_property(np, "AAPL,address-step", NULL);
+ psteps = of_get_property(np, "AAPL,address-step", NULL);
steps = psteps ? (*psteps) : 0x10;
for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++)
steps >>= 1;
/* Select interface rate */
host->speed = KW_I2C_MODE_25KHZ;
- prate = get_property(np, "AAPL,i2c-rate", NULL);
+ prate = of_get_property(np, "AAPL,i2c-rate", NULL);
if (prate) switch(*prate) {
case 100:
host->speed = KW_I2C_MODE_100KHZ;
@@ -619,7 +619,7 @@ static void __init kw_i2c_probe(void)
} else {
for (child = NULL;
(child = of_get_next_child(np, child)) != NULL;) {
- const u32 *reg = get_property(child,
+ const u32 *reg = of_get_property(child,
"reg", NULL);
if (reg == NULL)
continue;
@@ -905,7 +905,7 @@ static void __init smu_i2c_probe(void)
if (strcmp(busnode->type, "i2c") &&
strcmp(busnode->type, "i2c-bus"))
continue;
- reg = get_property(busnode, "reg", NULL);
+ reg = of_get_property(busnode, "reg", NULL);
if (reg == NULL)
continue;
@@ -950,7 +950,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node)
if (p == bus->busnode) {
if (prev && bus->flags & pmac_i2c_multibus) {
const u32 *reg;
- reg = get_property(prev, "reg", NULL);
+ reg = of_get_property(prev, "reg",
+ NULL);
if (!reg)
continue;
if (((*reg) >> 8) != bus->channel)
@@ -971,7 +972,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus);
u8 pmac_i2c_get_dev_addr(struct device_node *device)
{
- const u32 *reg = get_property(device, "reg", NULL);
+ const u32 *reg = of_get_property(device, "reg", NULL);
if (reg == NULL)
return 0;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 431a685..092cef4 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -70,11 +70,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
int len;
/* For PCI<->PCI bridges or CardBus bridges, we go down */
- class_code = get_property(node, "class-code", NULL);
+ class_code = of_get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
- bus_range = get_property(node, "bus-range", &len);
+ bus_range = of_get_property(node, "bus-range", &len);
if (bus_range != NULL && len > 2 * sizeof(int)) {
if (bus_range[1] > higher)
higher = bus_range[1];
@@ -246,8 +246,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
if (np == NULL)
return PCIBIOS_DEVICE_NOT_FOUND;
- vendor = get_property(np, "vendor-id", NULL);
- device = get_property(np, "device-id", NULL);
+ vendor = of_get_property(np, "vendor-id", NULL);
+ device = of_get_property(np, "device-id", NULL);
if (vendor == NULL || device == NULL)
return PCIBIOS_DEVICE_NOT_FOUND;
@@ -691,17 +691,17 @@ static void __init fixup_nec_usb2(void)
const u32 *prop;
u8 bus, devfn;
- prop = get_property(nec, "vendor-id", NULL);
+ prop = of_get_property(nec, "vendor-id", NULL);
if (prop == NULL)
continue;
if (0x1033 != *prop)
continue;
- prop = get_property(nec, "device-id", NULL);
+ prop = of_get_property(nec, "device-id", NULL);
if (prop == NULL)
continue;
if (0x0035 != *prop)
continue;
- prop = get_property(nec, "reg", NULL);
+ prop = of_get_property(nec, "reg", NULL);
if (prop == NULL)
continue;
devfn = (prop[0] >> 8) & 0xff;
@@ -909,7 +909,7 @@ static int __init add_bridge(struct device_node *dev)
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
/* Get bus range if any */
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 5c6c15c..45d54b9 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -114,7 +114,7 @@ static void macio_gpio_init_one(struct macio_chip *macio)
* we just create them all
*/
for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) {
- const u32 *reg = get_property(gp, "reg", NULL);
+ const u32 *reg = of_get_property(gp, "reg", NULL);
unsigned long offset;
if (reg == NULL)
continue;
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index a128553..8543423 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -820,7 +820,7 @@ struct pmf_function *__pmf_find_function(struct device_node *target,
* one, then we fallback to a direct call attempt
*/
snprintf(fname, 63, "platform-%s", name);
- prop = get_property(target, fname, NULL);
+ prop = of_get_property(target, fname, NULL);
if (prop == NULL)
goto find_it;
ph = *prop;
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 5e5c0e4..f59d311 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -482,7 +482,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
flags |= MPIC_WANTS_RESET;
- if (get_property(np, "big-endian", NULL))
+ if (of_get_property(np, "big-endian", NULL))
flags |= MPIC_BIG_ENDIAN;
/* Primary Big Endian means HT interrupts. This is quite dodgy
@@ -510,7 +510,7 @@ static int __init pmac_pic_probe_mpic(void)
for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
!= NULL;) {
if (master == NULL &&
- get_property(np, "interrupts", NULL) == NULL)
+ of_get_property(np, "interrupts", NULL) == NULL)
master = of_node_get(np);
else if (slave == NULL)
slave = of_node_get(np);
@@ -575,7 +575,7 @@ void __init pmac_pic_init(void)
#ifdef CONFIG_PPC32
if (!pmac_newworld)
flags |= OF_IMAP_OLDWORLD_MAC;
- if (get_property(of_chosen, "linux,bootx", NULL) != NULL)
+ if (of_get_property(of_chosen, "linux,bootx", NULL) != NULL)
flags |= OF_IMAP_NO_PHANDLE;
#endif /* CONFIG_PPC_32 */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 651fa42..4de273d 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -135,12 +135,12 @@ static void pmac_show_cpuinfo(struct seq_file *m)
seq_printf(m, "machine\t\t: ");
np = of_find_node_by_path("/");
if (np != NULL) {
- pp = get_property(np, "model", NULL);
+ pp = of_get_property(np, "model", NULL);
if (pp != NULL)
seq_printf(m, "%s\n", pp);
else
seq_printf(m, "PowerMac\n");
- pp = get_property(np, "compatible", &plen);
+ pp = of_get_property(np, "compatible", &plen);
if (pp != NULL) {
seq_printf(m, "motherboard\t:");
while (plen > 0) {
@@ -164,11 +164,13 @@ static void pmac_show_cpuinfo(struct seq_file *m)
if (np == NULL)
np = of_find_node_by_type(NULL, "cache");
if (np != NULL) {
- const unsigned int *ic = get_property(np, "i-cache-size", NULL);
- const unsigned int *dc = get_property(np, "d-cache-size", NULL);
+ const unsigned int *ic =
+ of_get_property(np, "i-cache-size", NULL);
+ const unsigned int *dc =
+ of_get_property(np, "d-cache-size", NULL);
seq_printf(m, "L2 cache\t:");
has_l2cache = 1;
- if (get_property(np, "cache-unified", NULL) != 0 && dc) {
+ if (of_get_property(np, "cache-unified", NULL) != 0 && dc) {
seq_printf(m, " %dK unified", *dc / 1024);
} else {
if (ic)
@@ -177,7 +179,7 @@ static void pmac_show_cpuinfo(struct seq_file *m)
seq_printf(m, "%s %dK data",
(ic? " +": ""), *dc / 1024);
}
- pp = get_property(np, "ram-type", NULL);
+ pp = of_get_property(np, "ram-type", NULL);
if (pp)
seq_printf(m, " %s", pp);
seq_printf(m, "\n");
@@ -254,7 +256,7 @@ static void __init l2cr_init(void)
np = find_type_devices("cpu");
if (np != 0) {
const unsigned int *l2cr =
- get_property(np, "l2cr-value", NULL);
+ of_get_property(np, "l2cr-value", NULL);
if (l2cr != 0) {
ppc_override_l2cr = 1;
ppc_override_l2cr_value = *l2cr;
@@ -286,7 +288,7 @@ static void __init pmac_setup_arch(void)
loops_per_jiffy = 50000000 / HZ;
cpu = of_find_node_by_type(NULL, "cpu");
if (cpu != NULL) {
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != NULL) {
if (pvr >= 0x30 && pvr < 0x80)
/* PPC970 etc. */
@@ -303,7 +305,7 @@ static void __init pmac_setup_arch(void)
/* See if newworld or oldworld */
for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; )
- if (get_property(ic, "interrupt-controller", NULL))
+ if (of_get_property(ic, "interrupt-controller", NULL))
break;
if (ic) {
pmac_newworld = 1;
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index d73fb73..20f3286 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -567,7 +567,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc);
if (pmac_tb_clock_chip_host == NULL)
continue;
- reg = get_property(cc, "reg", NULL);
+ reg = of_get_property(cc, "reg", NULL);
if (reg == NULL)
continue;
switch (*reg) {
@@ -695,7 +695,7 @@ static void __init smp_core99_setup(int ncpus)
struct device_node *cpus =
of_find_node_by_path("/cpus");
if (cpus &&
- get_property(cpus, "platform-cpu-timebase", NULL)) {
+ of_get_property(cpus, "platform-cpu-timebase", NULL)) {
pmac_tb_freeze = smp_core99_pfunc_tb_freeze;
printk(KERN_INFO "Processor timebase sync using"
" platform function\n");
@@ -712,7 +712,7 @@ static void __init smp_core99_setup(int ncpus)
core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */
cpu = of_find_node_by_type(NULL, "cpu");
if (cpu != NULL) {
- tbprop = get_property(cpu, "timebase-enable", NULL);
+ tbprop = of_get_property(cpu, "timebase-enable", NULL);
if (tbprop)
core99_tb_gpio = *tbprop;
of_node_put(cpu);
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index 379db05..47de4d3 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -81,7 +81,7 @@ void udbg_scc_init(int force_scc)
macio = of_get_parent(escc);
if (macio == NULL)
goto bail;
- path = get_property(of_chosen, "linux,stdout-path", NULL);
+ path = of_get_property(of_chosen, "linux,stdout-path", NULL);
if (path != NULL)
stdout = of_find_node_by_path(path);
for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) {
@@ -96,13 +96,13 @@ void udbg_scc_init(int force_scc)
ch = ch_def ? ch_def : ch_a;
/* Get address within mac-io ASIC */
- reg = get_property(escc, "reg", NULL);
+ reg = of_get_property(escc, "reg", NULL);
if (reg == NULL)
goto bail;
addr = reg[0];
/* Get address of mac-io PCI itself */
- reg = get_property(macio, "assigned-addresses", NULL);
+ reg = of_get_property(macio, "assigned-addresses", NULL);
if (reg == NULL)
goto bail;
addr += reg[2];
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 07/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/cell
2007-04-03 12:32 ` [PATCH 06/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/powermac Stephen Rothwell
@ 2007-04-03 12:35 ` Stephen Rothwell
2007-04-03 12:37 ` [PATCH 08/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:35 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/cell/cbe_regs.c | 7 +++----
arch/powerpc/platforms/cell/cbe_thermal.c | 4 ++--
arch/powerpc/platforms/cell/interrupt.c | 4 ++--
arch/powerpc/platforms/cell/io-workarounds.c | 2 +-
arch/powerpc/platforms/cell/iommu.c | 8 ++++----
arch/powerpc/platforms/cell/setup.c | 2 +-
arch/powerpc/platforms/cell/spider-pic.c | 8 ++++----
arch/powerpc/platforms/cell/spu_manage.c | 18 +++++++++---------
arch/powerpc/platforms/cell/spufs/inode.c | 2 +-
9 files changed, 27 insertions(+), 28 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c
index 9a0ee62..7c94af4 100644
--- a/arch/powerpc/platforms/cell/cbe_regs.c
+++ b/arch/powerpc/platforms/cell/cbe_regs.c
@@ -174,16 +174,15 @@ void __init cbe_regs_init(void)
if (cbe_thread_map[i].cpu_node == cpu)
cbe_thread_map[i].regs = map;
- prop = get_property(cpu, "pervasive", NULL);
+ prop = of_get_property(cpu, "pervasive", NULL);
if (prop != NULL)
map->pmd_regs = ioremap(prop->address, prop->len);
- prop = get_property(cpu, "iic", NULL);
+ prop = of_get_property(cpu, "iic", NULL);
if (prop != NULL)
map->iic_regs = ioremap(prop->address, prop->len);
- prop = (struct address_prop *)get_property(cpu, "mic-tm",
- NULL);
+ prop = of_get_property(cpu, "mic-tm", NULL);
if (prop != NULL)
map->mic_tm_regs = ioremap(prop->address, prop->len);
}
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index 70e0d96..e8bcd2a 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -43,14 +43,14 @@ static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev)
/* returns the value for a given spu in a given register */
static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg)
{
- unsigned int *id;
+ const unsigned int *id;
union spe_reg value;
struct spu *spu;
/* getting the id from the reg attribute will not work on future device-tree layouts
* in future we should store the id to the spu struct and use it here */
spu = container_of(sysdev, struct spu, sysdev);
- id = (unsigned int *)get_property(spu_devnode(spu), "reg", NULL);
+ id = of_get_property(spu_devnode(spu), "reg", NULL);
value.val = in_be64(®->val);
return value.spe[*id];
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 6666d03..4fc4e92 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -261,7 +261,7 @@ static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
return -ENODEV;
if (intsize != 1)
return -ENODEV;
- val = get_property(ct, "#interrupt-cells", NULL);
+ val = of_get_property(ct, "#interrupt-cells", NULL);
if (val == NULL || *val != 1)
return -ENODEV;
@@ -327,7 +327,7 @@ static int __init setup_iic(void)
if (!device_is_compatible(dn,
"IBM,CBEA-Internal-Interrupt-Controller"))
continue;
- np = get_property(dn, "ibm,interrupt-server-ranges", NULL);
+ np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL);
if (np == NULL) {
printk(KERN_WARNING "IIC: CPU association not found\n");
of_node_put(dn);
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index 7c73128..d68d920 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -318,7 +318,7 @@ static int __init spider_pci_workaround_init(void)
*/
list_for_each_entry(phb, &hose_list, list_node) {
struct device_node *np = phb->arch_data;
- const char *model = get_property(np, "model", NULL);
+ const char *model = of_get_property(np, "model", NULL);
/* If no model property or name isn't exactly "pci", skip */
if (model == NULL || strcmp(np->name, "pci"))
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 7c953cc..760caa7 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -291,9 +291,9 @@ static int cell_iommu_find_ioc(int nid, unsigned long *base)
const unsigned int *nidp;
const unsigned long *tmp;
- nidp = get_property(np, "node-id", NULL);
+ nidp = of_get_property(np, "node-id", NULL);
if (nidp && *nidp == nid) {
- tmp = get_property(np, "ioc-translation", NULL);
+ tmp = of_get_property(np, "ioc-translation", NULL);
if (tmp) {
*base = *tmp;
of_node_put(np);
@@ -430,7 +430,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
struct iommu_window *window;
const unsigned int *ioid;
- ioid = get_property(np, "ioid", NULL);
+ ioid = of_get_property(np, "ioid", NULL);
if (ioid == NULL)
printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
np->full_name);
@@ -549,7 +549,7 @@ static int __init cell_iommu_get_window(struct device_node *np,
unsigned long index;
/* Use ibm,dma-window if available, else, hard code ! */
- dma_window = get_property(np, "ibm,dma-window", NULL);
+ dma_window = of_get_property(np, "ibm,dma-window", NULL);
if (dma_window == NULL) {
*base = 0;
*size = 0x80000000u;
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 36989c2..5c5fa34 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -71,7 +71,7 @@ static void cell_show_cpuinfo(struct seq_file *m)
root = of_find_node_by_path("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
seq_printf(m, "machine\t\t: CHRP %s\n", model);
of_node_put(root);
}
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 21a9ebd..fb1f157 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -254,25 +254,25 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
}
/* Now do the horrible hacks */
- tmp = get_property(pic->of_node, "#interrupt-cells", NULL);
+ tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL);
if (tmp == NULL)
return NO_IRQ;
intsize = *tmp;
- imap = get_property(pic->of_node, "interrupt-map", &imaplen);
+ imap = of_get_property(pic->of_node, "interrupt-map", &imaplen);
if (imap == NULL || imaplen < (intsize + 1))
return NO_IRQ;
iic = of_find_node_by_phandle(imap[intsize]);
if (iic == NULL)
return NO_IRQ;
imap += intsize + 1;
- tmp = get_property(iic, "#interrupt-cells", NULL);
+ tmp = of_get_property(iic, "#interrupt-cells", NULL);
if (tmp == NULL)
return NO_IRQ;
intsize = *tmp;
/* Assume unit is last entry of interrupt specifier */
unit = imap[intsize - 1];
/* Ok, we have a unit, now let's try to get the node */
- tmp = get_property(iic, "ibm,interrupt-server-ranges", NULL);
+ tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL);
if (tmp == NULL) {
of_node_put(iic);
return NO_IRQ;
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index e34599f..1d4562a 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -48,11 +48,11 @@ static u64 __init find_spu_unit_number(struct device_node *spe)
{
const unsigned int *prop;
int proplen;
- prop = get_property(spe, "unit-id", &proplen);
+ prop = of_get_property(spe, "unit-id", &proplen);
if (proplen == 4)
return (u64)*prop;
- prop = get_property(spe, "reg", &proplen);
+ prop = of_get_property(spe, "reg", &proplen);
if (proplen == 4)
return (u64)*prop;
@@ -76,12 +76,12 @@ static int __init spu_map_interrupts_old(struct spu *spu,
int nid;
/* Get the interrupt source unit from the device-tree */
- tmp = get_property(np, "isrc", NULL);
+ tmp = of_get_property(np, "isrc", NULL);
if (!tmp)
return -ENODEV;
isrc = tmp[0];
- tmp = get_property(np->parent->parent, "node-id", NULL);
+ tmp = of_get_property(np->parent->parent, "node-id", NULL);
if (!tmp) {
printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__);
nid = spu->node;
@@ -110,7 +110,7 @@ static void __iomem * __init spu_map_prop_old(struct spu *spu,
} __attribute__((packed)) *prop;
int proplen;
- prop = get_property(n, name, &proplen);
+ prop = of_get_property(n, name, &proplen);
if (prop == NULL || proplen != sizeof (struct address_prop))
return NULL;
@@ -124,11 +124,11 @@ static int __init spu_map_device_old(struct spu *spu)
int ret;
ret = -ENODEV;
- spu->name = get_property(node, "name", NULL);
+ spu->name = of_get_property(node, "name", NULL);
if (!spu->name)
goto out;
- prop = get_property(node, "local-store", NULL);
+ prop = of_get_property(node, "local-store", NULL);
if (!prop)
goto out;
spu->local_store_phys = *(unsigned long *)prop;
@@ -139,7 +139,7 @@ static int __init spu_map_device_old(struct spu *spu)
if (!spu->local_store)
goto out;
- prop = get_property(node, "problem", NULL);
+ prop = of_get_property(node, "problem", NULL);
if (!prop)
goto out_unmap;
spu->problem_phys = *(unsigned long *)prop;
@@ -226,7 +226,7 @@ static int __init spu_map_device(struct spu *spu)
struct device_node *np = spu->devnode;
int ret = -ENODEV;
- spu->name = get_property(np, "name", NULL);
+ spu->name = of_get_property(np, "name", NULL);
if (!spu->name)
goto out;
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 8079983..e3f4ee9 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -571,7 +571,7 @@ spufs_init_isolated_loader(void)
if (!dn)
return;
- loader = get_property(dn, "loader", &size);
+ loader = of_get_property(dn, "loader", &size);
if (!loader)
return;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 08/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms
2007-04-03 12:35 ` [PATCH 07/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/cell Stephen Rothwell
@ 2007-04-03 12:37 ` Stephen Rothwell
2007-04-03 12:39 ` [PATCH 09/17] [POWERPC] Rename get_property to of_get_property: sound Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:37 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/52xx/efika.c | 15 +++++++--------
arch/powerpc/platforms/52xx/lite5200.c | 6 +++---
arch/powerpc/platforms/52xx/mpc52xx_common.c | 2 +-
arch/powerpc/platforms/52xx/mpc52xx_pci.c | 2 +-
arch/powerpc/platforms/82xx/mpc82xx.c | 6 +++---
arch/powerpc/platforms/82xx/mpc82xx_ads.c | 12 ++++++------
arch/powerpc/platforms/83xx/pci.c | 2 +-
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 2 +-
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +-
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 2 +-
arch/powerpc/platforms/85xx/pci.c | 2 +-
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 4 ++--
arch/powerpc/platforms/86xx/pci.c | 2 +-
arch/powerpc/platforms/8xx/m8xx_setup.c | 8 ++++----
arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
arch/powerpc/platforms/celleb/iommu.c | 2 +-
arch/powerpc/platforms/celleb/pci.c | 18 +++++++++---------
arch/powerpc/platforms/celleb/setup.c | 2 +-
arch/powerpc/platforms/chrp/nvram.c | 2 +-
arch/powerpc/platforms/chrp/pci.c | 11 ++++++-----
arch/powerpc/platforms/chrp/setup.c | 17 +++++++++--------
arch/powerpc/platforms/embedded6xx/linkstation.c | 8 ++++----
arch/powerpc/platforms/embedded6xx/ls_uart.c | 4 ++--
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 4 ++--
arch/powerpc/platforms/iseries/iommu.c | 2 +-
arch/powerpc/platforms/iseries/pci.c | 4 ++--
arch/powerpc/platforms/iseries/viopath.c | 2 +-
arch/powerpc/platforms/maple/pci.c | 6 +++---
arch/powerpc/platforms/maple/setup.c | 12 ++++++------
arch/powerpc/platforms/pasemi/iommu.c | 2 +-
arch/powerpc/platforms/pasemi/setup.c | 2 +-
32 files changed, 85 insertions(+), 84 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 8de0341..a6bba97 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -112,7 +112,7 @@ void __init efika_pcisetup(void)
return;
}
- bus_range = get_property(pcictrl, "bus-range", &len);
+ bus_range = of_get_property(pcictrl, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING EFIKA_PLATFORM_NAME
": Can't get bus-range for %s\n", pcictrl->full_name);
@@ -158,18 +158,17 @@ void __init efika_pcisetup(void)
static void efika_show_cpuinfo(struct seq_file *m)
{
struct device_node *root;
- const char *revision = NULL;
- const char *codegendescription = NULL;
- const char *codegenvendor = NULL;
+ const char *revision;
+ const char *codegendescription;
+ const char *codegenvendor;
root = of_find_node_by_path("/");
if (!root)
return;
- revision = get_property(root, "revision", NULL);
- codegendescription =
- get_property(root, "CODEGEN,description", NULL);
- codegenvendor = get_property(root, "CODEGEN,vendor", NULL);
+ revision = of_get_property(root, "revision", NULL);
+ codegendescription = of_get_property(root, "CODEGEN,description", NULL);
+ codegenvendor = of_get_property(root, "CODEGEN,vendor", NULL);
if (codegendescription)
seq_printf(m, "machine\t\t: %s\n", codegendescription);
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index cc3b40d..4f5ebaa 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -94,8 +94,8 @@ static void __init lite5200_setup_arch(void)
np = of_find_node_by_type(NULL, "cpu");
if (np) {
- unsigned int *fp =
- (int *)get_property(np, "clock-frequency", NULL);
+ const unsigned int *fp =
+ of_get_property(np, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
@@ -132,7 +132,7 @@ void lite5200_show_cpuinfo(struct seq_file *m)
const char *model = NULL;
if (np)
- model = get_property(np, "model", NULL);
+ model = of_get_property(np, "model", NULL);
seq_printf(m, "vendor\t\t: Freescale Semiconductor\n");
seq_printf(m, "machine\t\t: %s\n", model ? model : "unknown");
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index ed0cb69..2dd415f 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -60,7 +60,7 @@ mpc52xx_find_ipb_freq(struct device_node *node)
of_node_get(node);
while (node) {
- p_ipb_freq = get_property(node, "bus-frequency", NULL);
+ p_ipb_freq = of_get_property(node, "bus-frequency", NULL);
if (p_ipb_freq)
break;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index faf161b..34d34a2 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -370,7 +370,7 @@ mpc52xx_add_bridge(struct device_node *node)
return -EINVAL;
}
- bus_range = get_property(node, "bus-range", &len);
+ bus_range = of_get_property(node, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get %s bus-range, assume bus 0\n",
node->full_name);
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
index 74e7892..cc9900d 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx.c
@@ -55,17 +55,17 @@
static int __init get_freq(char *name, unsigned long *val)
{
struct device_node *cpu;
- unsigned int *fp;
+ const unsigned int *fp;
int found = 0;
/* The cpu node should have timebase and clock frequency properties */
cpu = of_find_node_by_type(NULL, "cpu");
if (cpu) {
- fp = (unsigned int *)get_property(cpu, name, NULL);
+ fp = of_get_property(cpu, name, NULL);
if (fp) {
found = 1;
- *val = *fp++;
+ *val = *fp;
}
of_node_put(cpu);
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index 7334c1a..47cb09f 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -456,7 +456,7 @@ void m82xx_pci_init_irq(void)
iounmap(immap);
return;
}
- irq_map = get_property(np, "interrupt-map", &size);
+ irq_map = of_get_property(np, "interrupt-map", &size);
if ((!irq_map) || (size <= 7)) {
printk(KERN_INFO "No interrupt-map property of pci node\n");
iounmap(immap);
@@ -481,7 +481,7 @@ void m82xx_pci_init_irq(void)
}
pci_pic_node = of_node_get(np);
/* PCI interrupt controller registers: status and mask */
- regs = get_property(np, "reg", &size);
+ regs = of_get_property(np, "reg", &size);
if ((!regs) || (size <= 2)) {
printk(KERN_INFO "No reg property in pci pic node\n");
iounmap(immap);
@@ -521,20 +521,20 @@ void __init add_bridge(struct device_node *np)
struct pci_controller *hose;
struct resource r;
const int *bus_range;
- const void *ptr;
+ const uint *ptr;
memset(&r, 0, sizeof(r));
if (of_address_to_resource(np, 0, &r)) {
printk(KERN_INFO "No PCI reg property in device tree\n");
return;
}
- if (!(ptr = get_property(np, "clock-frequency", NULL))) {
+ if (!(ptr = of_get_property(np, "clock-frequency", NULL))) {
printk(KERN_INFO "No clock-frequency property in PCI node");
return;
}
- pci_clk_frq = *(uint *) ptr;
+ pci_clk_frq = *ptr;
of_node_put(np);
- bus_range = get_property(np, "bus-range", &len);
+ bus_range = of_get_property(np, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", np->full_name);
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
index 9c36505..774457d 100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
@@ -60,7 +60,7 @@ int __init add_bridge(struct device_node *dev)
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
/* Get bus range if any */
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 8ed034a..5d27621 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -227,7 +227,7 @@ static void __init mpc85xx_ads_setup_arch(void)
if (cpu != 0) {
const unsigned int *fp;
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4232686..7e71636 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -237,7 +237,7 @@ static void __init mpc85xx_cds_setup_arch(void)
if (cpu != 0) {
const unsigned int *fp;
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 81144d2..54db416 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -80,7 +80,7 @@ static void __init mpc85xx_mds_setup_arch(void)
np = of_find_node_by_type(NULL, "cpu");
if (np != NULL) {
const unsigned int *fp =
- get_property(np, "clock-frequency", NULL);
+ of_get_property(np, "clock-frequency", NULL);
if (fp != NULL)
loops_per_jiffy = *fp / HZ;
else
diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/platforms/85xx/pci.c
index 05930ee..48f17e2 100644
--- a/arch/powerpc/platforms/85xx/pci.c
+++ b/arch/powerpc/platforms/85xx/pci.c
@@ -51,7 +51,7 @@ int __init add_bridge(struct device_node *dev)
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
/* Get bus range if any */
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index f42f801..3d3d98f 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -349,7 +349,7 @@ mpc86xx_hpcn_setup_arch(void)
if (np != 0) {
const unsigned int *fp;
- fp = get_property(np, "clock-frequency", NULL);
+ fp = of_get_property(np, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
@@ -384,7 +384,7 @@ mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
root = of_find_node_by_path("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
seq_printf(m, "Machine\t\t: %s\n", model);
of_node_put(root);
diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c
index 481e18e..7e5a910 100644
--- a/arch/powerpc/platforms/86xx/pci.c
+++ b/arch/powerpc/platforms/86xx/pci.c
@@ -163,7 +163,7 @@ int __init add_bridge(struct device_node *dev)
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
/* Get bus range if any */
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int))
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 9ed7125..0901dba 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -85,17 +85,17 @@ init_internal_rtc(void)
static int __init get_freq(char *name, unsigned long *val)
{
struct device_node *cpu;
- unsigned int *fp;
+ const unsigned int *fp;
int found = 0;
/* The cpu node should have timebase and clock frequency properties */
cpu = of_find_node_by_type(NULL, "cpu");
if (cpu) {
- fp = (unsigned int *)get_property(cpu, name, NULL);
+ fp = of_get_property(cpu, name, NULL);
if (fp) {
found = 1;
- *val = *fp++;
+ *val = *fp;
}
of_node_put(cpu);
@@ -262,7 +262,7 @@ void mpc8xx_show_cpuinfo(struct seq_file *m)
root = of_find_node_by_path("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
seq_printf(m, "Machine\t\t: %s\n", model);
of_node_put(root);
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index baad9ac..a35315a 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -260,7 +260,7 @@ static void __init mpc86xads_setup_arch(void)
if (cpu != 0) {
const unsigned int *fp;
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index e4dcdfb..a57b577 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -346,7 +346,7 @@ static void __init mpc885ads_setup_arch(void)
if (cpu != 0) {
const unsigned int *fp;
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
index e94de6a..755d869 100644
--- a/arch/powerpc/platforms/celleb/iommu.c
+++ b/arch/powerpc/platforms/celleb/iommu.c
@@ -37,7 +37,7 @@ static int __init find_dma_window(u64 *io_space_id, u64 *ioid,
const unsigned long *dma_window;
for_each_node_by_type(dn, "ioif") {
- dma_window = get_property(dn, "toshiba,dma-window", NULL);
+ dma_window = of_get_property(dn, "toshiba,dma-window", NULL);
if (dma_window) {
*io_space_id = (dma_window[0] >> 32) & 0xffffffffUL;
*ioid = dma_window[0] & 0x7ffUL;
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index 98de836..d1adf34 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -309,13 +309,13 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
goto error;
}
- name = get_property(node, "model", &rlen);
+ name = of_get_property(node, "model", &rlen);
if (!name) {
printk(KERN_ERR "PCI: model property not found.\n");
goto error;
}
- wi4 = get_property(node, "reg", &rlen);
+ wi4 = of_get_property(node, "reg", &rlen);
if (wi4 == NULL)
goto error;
@@ -352,10 +352,10 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
}
pr_debug("PCI: res assigned 0x%016lx\n", (unsigned long)*res);
- wi0 = get_property(node, "device-id", NULL);
- wi1 = get_property(node, "vendor-id", NULL);
- wi2 = get_property(node, "class-code", NULL);
- wi3 = get_property(node, "revision-id", NULL);
+ wi0 = of_get_property(node, "device-id", NULL);
+ wi1 = of_get_property(node, "vendor-id", NULL);
+ wi2 = of_get_property(node, "class-code", NULL);
+ wi3 = of_get_property(node, "revision-id", NULL);
celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff);
celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff);
@@ -376,7 +376,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr);
- li = get_property(node, "interrupts", &rlen);
+ li = of_get_property(node, "interrupts", &rlen);
val = li[0];
celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1);
celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val);
@@ -424,7 +424,7 @@ static int __devinit phb_set_bus_ranges(struct device_node *dev,
const int *bus_range;
unsigned int len;
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int))
return 1;
@@ -451,7 +451,7 @@ int __devinit celleb_setup_phb(struct pci_controller *phb)
struct device_node *node;
unsigned int rlen;
- name = get_property(dev, "name", &rlen);
+ name = of_get_property(dev, "name", &rlen);
if (!name)
return 1;
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 5f4d0d9..ab1db9d 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -67,7 +67,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
root = of_find_node_by_path("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
/* using "CHRP" is to trick anaconda into installing FCx into Celleb */
seq_printf(m, "machine\t\t: %s %s\n", celleb_machine_type, model);
of_node_put(root);
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c
index 0dd4a64..8efd424 100644
--- a/arch/powerpc/platforms/chrp/nvram.c
+++ b/arch/powerpc/platforms/chrp/nvram.c
@@ -74,7 +74,7 @@ void __init chrp_nvram_init(void)
if (nvram == NULL)
return;
- nbytes_p = get_property(nvram, "#bytes", &proplen);
+ nbytes_p = of_get_property(nvram, "#bytes", &proplen);
if (nbytes_p == NULL || proplen != sizeof(unsigned int))
return;
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index ddb4a11..bddff33 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -218,7 +218,7 @@ chrp_find_bridges(void)
* properties to adequately identify them, so we have to
* look at what sort of machine this is as well.
*/
- machine = get_property(root, "model", NULL);
+ machine = of_get_property(root, "model", NULL);
if (machine != NULL) {
is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0;
is_mot = strncmp(machine, "MOT", 3) == 0;
@@ -237,7 +237,7 @@ chrp_find_bridges(void)
dev->full_name);
continue;
}
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s\n",
dev->full_name);
@@ -263,7 +263,7 @@ chrp_find_bridges(void)
hose->first_busno = bus_range[0];
hose->last_busno = bus_range[1];
- model = get_property(dev, "model", NULL);
+ model = of_get_property(dev, "model", NULL);
if (model == NULL)
model = "<none>";
if (device_is_compatible(dev, "IBM,python")) {
@@ -285,7 +285,8 @@ chrp_find_bridges(void)
r.start + 0x000f8000,
r.start + 0x000f8010);
if (index == 0) {
- dma = get_property(dev, "system-dma-base",&len);
+ dma = of_get_property(dev, "system-dma-base",
+ &len);
if (dma && len >= sizeof(*dma)) {
dma = (unsigned int *)
(((unsigned long)dma) +
@@ -303,7 +304,7 @@ chrp_find_bridges(void)
/* check the first bridge for a property that we can
use to set pci_dram_offset */
- dma = get_property(dev, "ibm,dma-ranges", &len);
+ dma = of_get_property(dev, "ibm,dma-ranges", &len);
if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
pci_dram_offset = dma[2] - dma[3];
printk("pci_dram_offset = %lx\n", pci_dram_offset);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index c0d07fb..d23e899 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -113,7 +113,7 @@ void chrp_show_cpuinfo(struct seq_file *m)
root = find_path_device("/");
if (root)
- model = get_property(root, "model", NULL);
+ model = of_get_property(root, "model", NULL);
seq_printf(m, "machine\t\t: CHRP %s\n", model);
/* longtrail (goldengate) stuff */
@@ -206,7 +206,8 @@ static void __init sio_init(void)
struct device_node *root;
if ((root = find_path_device("/")) &&
- !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13)) {
+ !strncmp(of_get_property(root, "model", NULL),
+ "IBM,LongTrail", 13)) {
/* logical device 0 (KBC/Keyboard) */
sio_fixup_irq("keyboard", 0, 1, 2);
/* select logical device 1 (KBC/Mouse) */
@@ -226,7 +227,7 @@ static void __init pegasos_set_l2cr(void)
/* Enable L2 cache if needed */
np = find_type_devices("cpu");
if (np != NULL) {
- const unsigned int *l2cr = get_property(np, "l2cr", NULL);
+ const unsigned int *l2cr = of_get_property(np, "l2cr", NULL);
if (l2cr == NULL) {
printk ("Pegasos l2cr : no cpu l2cr property found\n");
return;
@@ -257,7 +258,7 @@ void __init chrp_setup_arch(void)
loops_per_jiffy = 50000000/HZ;
if (root)
- machine = get_property(root, "model", NULL);
+ machine = of_get_property(root, "model", NULL);
if (machine && strncmp(machine, "Pegasos", 7) == 0) {
_chrp_type = _CHRP_Pegasos;
} else if (machine && strncmp(machine, "IBM", 3) == 0) {
@@ -361,7 +362,7 @@ static void __init chrp_find_openpic(void)
return;
root = of_find_node_by_path("/");
if (root) {
- opprop = get_property(root, "platform-open-pic", &oplen);
+ opprop = of_get_property(root, "platform-open-pic", &oplen);
na = of_n_addr_cells(root);
}
if (opprop && oplen >= na * sizeof(unsigned int)) {
@@ -378,7 +379,7 @@ static void __init chrp_find_openpic(void)
printk(KERN_INFO "OpenPIC at %lx\n", opaddr);
- iranges = get_property(np, "interrupt-ranges", &len);
+ iranges = of_get_property(np, "interrupt-ranges", &len);
if (iranges == NULL)
len = 0; /* non-distributed mpic */
else
@@ -464,7 +465,7 @@ static void __init chrp_find_8259(void)
* from anyway
*/
for (np = find_devices("pci"); np != NULL; np = np->next) {
- const unsigned int *addrp = get_property(np,
+ const unsigned int *addrp = of_get_property(np,
"8259-interrupt-acknowledge", NULL);
if (addrp == NULL)
@@ -544,7 +545,7 @@ chrp_init2(void)
*/
device = find_devices("rtas");
if (device)
- p = get_property(device, "rtas-event-scan-rate", NULL);
+ p = of_get_property(device, "rtas-event-scan-rate", NULL);
if (p && *p) {
/*
* Arrange to call chrp_event_scan at least *p times
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index 3f6c411..b412f00 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -58,11 +58,11 @@ static int __init add_bridge(struct device_node *dev)
{
int len;
struct pci_controller *hose;
- int *bus_range;
+ const int *bus_range;
printk("Adding PCI host bridge %s\n", dev->full_name);
- bus_range = (int *) get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int))
printk(KERN_WARNING "Can't get bus-range for %s, assume"
" bus 0\n", dev->full_name);
@@ -106,7 +106,7 @@ static void __init linkstation_init_IRQ(void)
{
struct mpic *mpic;
struct device_node *dnp;
- void *prop;
+ const u32 *prop;
int size;
phys_addr_t paddr;
@@ -114,7 +114,7 @@ static void __init linkstation_init_IRQ(void)
if (dnp == NULL)
return;
- prop = (struct device_node *)get_property(dnp, "reg", &size);
+ prop = of_get_property(dnp, "reg", &size);
paddr = (phys_addr_t)of_translate_address(dnp, prop);
mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC ");
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index 0e83776..d0bee9f 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -110,8 +110,8 @@ static int __init ls_uarts_init(void)
if (!avr)
return -EINVAL;
- avr_clock = *(u32*)get_property(avr, "clock-frequency", &len);
- phys_addr = ((u32*)get_property(avr, "reg", &len))[0];
+ avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len);
+ phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0];
if (!avr_clock || !phys_addr)
return -EINVAL;
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 9922574..aa493e4 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -82,7 +82,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
if (cpu != 0) {
const unsigned int *fp;
- fp = get_property(cpu, "clock-frequency", NULL);
+ fp = of_get_property(cpu, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy = *fp / HZ;
else
@@ -133,7 +133,7 @@ static void __init mpc7448_hpc2_init_IRQ(void)
tsi_pic = of_find_node_by_type(NULL, "open-pic");
if (tsi_pic) {
unsigned int size;
- const void *prop = get_property(tsi_pic, "reg", &size);
+ const void *prop = of_get_property(tsi_pic, "reg", &size);
mpic_paddr = of_translate_address(tsi_pic, prop);
}
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 7df2902..3b6a966 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -171,7 +171,7 @@ void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn)
{
struct iommu_table *tbl;
struct pci_dn *pdn = PCI_DN(dn);
- const u32 *lsn = get_property(dn, "linux,logical-slot-number", NULL);
+ const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL);
BUG_ON(lsn == NULL);
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 4a06d9c..0ae3c00 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -177,7 +177,7 @@ void __init iSeries_pci_final_fixup(void)
struct pci_dn *pdn = PCI_DN(node);
const u32 *agent;
- agent = get_property(node, "linux,agent-id", NULL);
+ agent = of_get_property(node, "linux,agent-id", NULL);
if ((pdn != NULL) && (agent != NULL)) {
u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
pdn->bussubno);
@@ -755,7 +755,7 @@ void __init iSeries_pcibios_init(void)
if ((node->type == NULL) || (strcmp(node->type, "pci") != 0))
continue;
- busp = get_property(node, "bus-range", NULL);
+ busp = of_get_property(node, "bus-range", NULL);
if (busp == NULL)
continue;
bus = *busp;
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index e2100ec..2ca2d8a 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -155,7 +155,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
node = of_find_node_by_path("/");
sysid = NULL;
if (node != NULL)
- sysid = get_property(node, "system-id", NULL);
+ sysid = of_get_property(node, "system-id", NULL);
if (sysid == NULL)
seq_printf(m, "SRLNBR=<UNKNOWN>\n");
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index ab5a6f1..b1d3b99 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -44,11 +44,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
int len;
/* For PCI<->PCI bridges or CardBus bridges, we go down */
- class_code = get_property(node, "class-code", NULL);
+ class_code = of_get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
- bus_range = get_property(node, "bus-range", &len);
+ bus_range = of_get_property(node, "bus-range", &len);
if (bus_range != NULL && len > 2 * sizeof(int)) {
if (bus_range[1] > higher)
higher = bus_range[1];
@@ -454,7 +454,7 @@ static int __init add_bridge(struct device_node *dev)
DBG("Adding PCI host bridge %s\n", dev->full_name);
- bus_range = get_property(dev, "bus-range", &len);
+ bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
dev->full_name);
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index a3f05c5..b05eb43 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -114,8 +114,8 @@ static void maple_restart(char *cmd)
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
goto fail;
}
- maple_nvram_offset = get_property(sp, "restart-addr", NULL);
- maple_nvram_command = get_property(sp, "restart-value", NULL);
+ maple_nvram_offset = of_get_property(sp, "restart-addr", NULL);
+ maple_nvram_command = of_get_property(sp, "restart-value", NULL);
of_node_put(sp);
/* send command */
@@ -141,8 +141,8 @@ static void maple_power_off(void)
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
goto fail;
}
- maple_nvram_offset = get_property(sp, "power-off-addr", NULL);
- maple_nvram_command = get_property(sp, "power-off-value", NULL);
+ maple_nvram_offset = of_get_property(sp, "power-off-addr", NULL);
+ maple_nvram_command = of_get_property(sp, "power-off-value", NULL);
of_node_put(sp);
/* send command */
@@ -250,7 +250,7 @@ static void __init maple_init_IRQ(void)
/* Find address list in /platform-open-pic */
root = of_find_node_by_path("/");
naddr = of_n_addr_cells(root);
- opprop = get_property(root, "platform-open-pic", &opplen);
+ opprop = of_get_property(root, "platform-open-pic", &opplen);
if (opprop != 0) {
openpic_addr = of_read_number(opprop, naddr);
has_isus = (opplen > naddr);
@@ -261,7 +261,7 @@ static void __init maple_init_IRQ(void)
BUG_ON(openpic_addr == 0);
/* Check for a big endian MPIC */
- if (get_property(np, "big-endian", NULL) != NULL)
+ if (of_get_property(np, "big-endian", NULL) != NULL)
flags |= MPIC_BIG_ENDIAN;
/* XXX Maple specific bits */
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 07819cd..95fa6a7 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -249,7 +249,7 @@ void iommu_init_early_pasemi(void)
iommu_off = 1;
#else
iommu_off = of_chosen &&
- get_property(of_chosen, "linux,iommu-off", NULL);
+ of_get_property(of_chosen, "linux,iommu-off", NULL);
#endif
if (iommu_off) {
/* Direct I/O, IOMMU off */
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index d4fd613..32a614c 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -137,7 +137,7 @@ static __init void pas_init_IRQ(void)
/* Find address list in /platform-open-pic */
root = of_find_node_by_path("/");
naddr = of_n_addr_cells(root);
- opprop = get_property(root, "platform-open-pic", &opplen);
+ opprop = of_get_property(root, "platform-open-pic", &opplen);
if (!opprop) {
printk(KERN_ERR "No platform-open-pic property.\n");
of_node_put(root);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 09/17] [POWERPC] Rename get_property to of_get_property: sound
2007-04-03 12:37 ` [PATCH 08/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms Stephen Rothwell
@ 2007-04-03 12:39 ` Stephen Rothwell
2007-04-03 12:40 ` [PATCH 10/17] [POWERPC] Rename get_property to of_get_property: drivers/macintosh Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:39 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
sound/aoa/codecs/snd-aoa-codec-onyx.c | 2 +-
sound/aoa/codecs/snd-aoa-codec-tas.c | 4 ++--
sound/aoa/core/snd-aoa-gpio-feature.c | 6 +++---
sound/aoa/fabrics/snd-aoa-fabric-layout.c | 6 +++---
sound/aoa/soundbus/core.c | 2 +-
sound/aoa/soundbus/i2sbus/i2sbus-core.c | 5 +++--
sound/oss/dmasound/dmasound_awacs.c | 12 ++++++------
sound/oss/dmasound/tas_common.c | 2 +-
sound/ppc/pmac.c | 14 +++++++-------
sound/ppc/tumbler.c | 20 ++++++++++----------
10 files changed, 37 insertions(+), 36 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
index bf7f031..7f980be 100644
--- a/sound/aoa/codecs/snd-aoa-codec-onyx.c
+++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c
@@ -1064,7 +1064,7 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
if (device_is_compatible(dev, "pcm3052")) {
const u32 *addr;
printk(KERN_DEBUG PFX "found pcm3052\n");
- addr = get_property(dev, "reg", NULL);
+ addr = of_get_property(dev, "reg", NULL);
if (!addr)
return -ENODEV;
return onyx_create(adapter, dev, (*addr)>>1);
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index ed6bdb0..ceca384 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -941,7 +941,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
if (device_is_compatible(dev, "tas3004")) {
const u32 *addr;
printk(KERN_DEBUG PFX "found tas3004\n");
- addr = get_property(dev, "reg", NULL);
+ addr = of_get_property(dev, "reg", NULL);
if (!addr)
continue;
return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
@@ -953,7 +953,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
const u32 *_addr;
u32 addr;
printk(KERN_DEBUG PFX "found 'deq' node\n");
- _addr = (u32 *) get_property(dev, "i2c-address", NULL);
+ _addr = of_get_property(dev, "i2c-address", NULL);
if (!_addr)
continue;
addr = ((*_addr) >> 1) & 0x7f;
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index d34e5db..805dcbf 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -71,7 +71,7 @@ static struct device_node *get_gpio(char *name,
if (!gpio)
return NULL;
while ((np = of_get_next_child(gpio, np))) {
- audio_gpio = get_property(np, "audio-gpio", NULL);
+ audio_gpio = of_get_property(np, "audio-gpio", NULL);
if (!audio_gpio)
continue;
if (strcmp(audio_gpio, name) == 0)
@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name,
return NULL;
}
- reg = get_property(np, "reg", NULL);
+ reg = of_get_property(np, "reg", NULL);
if (!reg)
return NULL;
@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name,
if (*gpioptr < 0x50)
*gpioptr += 0x50;
- reg = get_property(np, "audio-gpio-active-state", NULL);
+ reg = of_get_property(np, "audio-gpio-active-state", NULL);
if (!reg)
/* Apple seems to default to 1, but
* that doesn't seem right at least on most
diff --git a/sound/aoa/fabrics/snd-aoa-fabric-layout.c b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
index 7e38809..9880628 100644
--- a/sound/aoa/fabrics/snd-aoa-fabric-layout.c
+++ b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
@@ -732,7 +732,7 @@ static int check_codec(struct aoa_codec *codec,
if (codec->node && (strcmp(codec->node->name, "codec") == 0)) {
snprintf(propname, sizeof(propname),
"platform-%s-codec-ref", codec->name);
- ref = get_property(ldev->sound, propname, NULL);
+ ref = of_get_property(ldev->sound, propname, NULL);
if (!ref) {
printk(KERN_INFO "snd-aoa-fabric-layout: "
"required property %s not present\n", propname);
@@ -946,7 +946,7 @@ static struct aoa_fabric layout_fabric = {
static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
{
struct device_node *sound = NULL;
- unsigned int *layout_id;
+ const unsigned int *layout_id;
struct layout *layout;
struct layout_dev *ldev = NULL;
int err;
@@ -962,7 +962,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
}
if (!sound) return -ENODEV;
- layout_id = (unsigned int *) get_property(sound, "layout-id", NULL);
+ layout_id = of_get_property(sound, "layout-id", NULL);
if (!layout_id)
goto outnodev;
printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n",
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c
index 45680b5..6f004f7 100644
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -96,7 +96,7 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp,
* it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */
- compat = get_property(of->node, "compatible", &cplen);
+ compat = of_get_property(of->node, "compatible", &cplen);
while (compat && cplen > 0) {
envp[i++] = scratch;
length = scnprintf (scratch, buffer_size,
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
index bbe50a0..79fc4bc 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus-core.c
+++ b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
@@ -141,7 +141,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
rc = of_address_to_resource(parent, pindex, res);
if (rc)
goto bail;
- reg = get_property(np, "reg", NULL);
+ reg = of_get_property(np, "reg", NULL);
if (reg == NULL) {
rc = -ENXIO;
goto bail;
@@ -188,7 +188,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
}
}
if (i == 1) {
- const u32 *layout_id = get_property(sound, "layout-id", NULL);
+ const u32 *layout_id =
+ of_get_property(sound, "layout-id", NULL);
if (layout_id) {
layout = *layout_id;
snprintf(dev->sound.modalias, 32,
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index 7aa4d43..977b91c 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -357,7 +357,7 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
while(np != 0) {
if (name) {
const char *property =
- get_property(np,"audio-gpio",NULL);
+ of_get_property(np,"audio-gpio",NULL);
if (property != 0 && strcmp(property,name) == 0)
break;
} else if (compatible && device_is_compatible(np, compatible))
@@ -366,11 +366,11 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
}
if (!np)
return -ENODEV;
- pp = get_property(np, "AAPL,address", NULL);
+ pp = of_get_property(np, "AAPL,address", NULL);
if (!pp)
return -ENODEV;
*gpio_addr = (*pp) & 0x0000ffff;
- pp = get_property(np, "audio-gpio-active-state", NULL);
+ pp = of_get_property(np, "audio-gpio-active-state", NULL);
if (pp)
*gpio_pol = *pp;
else
@@ -2977,16 +2977,16 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
sound_device_id = 0;
/* device ID appears post g3 b&w */
- prop = get_property(info, "device-id", NULL);
+ prop = of_get_property(info, "device-id", NULL);
if (prop != 0)
sound_device_id = *prop;
/* look for a property saying what sample rates
are available */
- prop = get_property(info, "sample-rates", &l);
+ prop = of_get_property(info, "sample-rates", &l);
if (prop == 0)
- prop = get_property(info, "output-frame-rates", &l);
+ prop = of_get_property(info, "output-frame-rates", &l);
/* if it's there use it to set up frame rates */
init_frame_rates(prop, l) ;
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 5e2c0ae..1125760 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -200,7 +200,7 @@ tas_init(int driver_id, const char *driver_name)
tas_node = find_devices("deq");
if (tas_node == NULL)
return -ENODEV;
- paddr = get_property(tas_node, "i2c-address", NULL);
+ paddr = of_get_property(tas_node, "i2c-address", NULL);
if (paddr) {
tas_i2c_address = (*paddr) >> 1;
printk(KERN_INFO "using i2c address: 0x%x from device-tree\n",
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index c64af55..5e82968 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -864,7 +864,8 @@ static void __init detect_byte_swap(struct snd_pmac *chip)
static int __init snd_pmac_detect(struct snd_pmac *chip)
{
struct device_node *sound = NULL;
- unsigned int *prop, l;
+ const unsigned int *prop;
+ unsigned int l;
struct macio_chip* macio;
if (!machine_is(powermac))
@@ -923,10 +924,10 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
}
if (! sound)
return -ENODEV;
- prop = (unsigned int *) get_property(sound, "sub-frame", NULL);
+ prop = of_get_property(sound, "sub-frame", NULL);
if (prop && *prop < 16)
chip->subframe = *prop;
- prop = (unsigned int *) get_property(sound, "layout-id", NULL);
+ prop = of_get_property(sound, "layout-id", NULL);
if (prop) {
/* partly deprecate snd-powermac, for those machines
* that have a layout-id property for now */
@@ -967,7 +968,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
chip->freq_table = tumbler_freqs;
chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
}
- prop = (unsigned int *)get_property(sound, "device-id", NULL);
+ prop = of_get_property(sound, "device-id", NULL);
if (prop)
chip->device_id = *prop;
chip->has_iic = (find_devices("perch") != NULL);
@@ -997,10 +998,9 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
/* look for a property saying what sample rates
are available */
- prop = (unsigned int *) get_property(sound, "sample-rates", &l);
+ prop = of_get_property(sound, "sample-rates", &l);
if (! prop)
- prop = (unsigned int *) get_property(sound,
- "output-frame-rates", &l);
+ prop = of_get_property(sound, "output-frame-rates", &l);
if (prop) {
int i;
chip->freqs_ok = 0;
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 8f074c7..8e01b55 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1037,7 +1037,7 @@ static struct device_node *find_audio_device(const char *name)
return NULL;
for (np = np->child; np; np = np->sibling) {
- const char *property = get_property(np, "audio-gpio", NULL);
+ const char *property = of_get_property(np, "audio-gpio", NULL);
if (property && strcmp(property, name) == 0)
return np;
}
@@ -1077,9 +1077,9 @@ static long tumbler_find_device(const char *device, const char *platform,
return -ENODEV;
}
- base = get_property(node, "AAPL,address", NULL);
+ base = of_get_property(node, "AAPL,address", NULL);
if (! base) {
- base = get_property(node, "reg", NULL);
+ base = of_get_property(node, "reg", NULL);
if (!base) {
DBG("(E) cannot find address for device %s !\n", device);
snd_printd("cannot find address for device %s\n", device);
@@ -1093,7 +1093,7 @@ static long tumbler_find_device(const char *device, const char *platform,
gp->addr = addr & 0x0000ffff;
/* Try to find the active state, default to 0 ! */
- base = get_property(node, "audio-gpio-active-state", NULL);
+ base = of_get_property(node, "audio-gpio-active-state", NULL);
if (base) {
gp->active_state = *base;
gp->active_val = (*base) ? 0x5 : 0x4;
@@ -1108,7 +1108,7 @@ static long tumbler_find_device(const char *device, const char *platform,
* as we don't yet have an interpreter for these things
*/
if (platform)
- prop = get_property(node, platform, NULL);
+ prop = of_get_property(node, platform, NULL);
if (prop) {
if (prop[3] == 0x9 && prop[4] == 0x9) {
gp->active_val = 0xd;
@@ -1310,7 +1310,7 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
{
int i, err;
struct pmac_tumbler *mix;
- u32 *paddr;
+ const u32 *paddr;
struct device_node *tas_node, *np;
char *chipname;
@@ -1331,9 +1331,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
for (np = chip->node->child; np; np = np->sibling) {
if (!strcmp(np->name, "sound")) {
- if (get_property(np, "has-anded-reset", NULL))
+ if (of_get_property(np, "has-anded-reset", NULL))
mix->anded_reset = 1;
- if (get_property(np, "layout-id", NULL))
+ if (of_get_property(np, "layout-id", NULL))
mix->reset_on_sleep = 0;
break;
}
@@ -1348,9 +1348,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
if (tas_node == NULL)
return -ENODEV;
- paddr = (u32 *)get_property(tas_node, "i2c-address", NULL);
+ paddr = of_get_property(tas_node, "i2c-address", NULL);
if (paddr == NULL)
- paddr = (u32 *)get_property(tas_node, "reg", NULL);
+ paddr = of_get_property(tas_node, "reg", NULL);
if (paddr)
mix->i2c.addr = (*paddr) >> 1;
else
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 10/17] [POWERPC] Rename get_property to of_get_property: drivers/macintosh
2007-04-03 12:39 ` [PATCH 09/17] [POWERPC] Rename get_property to of_get_property: sound Stephen Rothwell
@ 2007-04-03 12:40 ` Stephen Rothwell
2007-04-03 12:42 ` [PATCH 11/17] [POWERPC] Rename get_property to of_get_property: drivers/char Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:40 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/macintosh/macio_asic.c | 4 ++--
drivers/macintosh/macio_sysfs.c | 4 ++--
drivers/macintosh/rack-meter.c | 2 +-
drivers/macintosh/smu.c | 6 +++---
drivers/macintosh/therm_adt746x.c | 8 ++++----
drivers/macintosh/therm_pm72.c | 8 ++++----
drivers/macintosh/therm_windtunnel.c | 2 +-
drivers/macintosh/via-cuda.c | 2 +-
drivers/macintosh/via-pmu-led.c | 2 +-
drivers/macintosh/via-pmu.c | 6 +++---
drivers/macintosh/windfarm_lm75_sensor.c | 2 +-
drivers/macintosh/windfarm_max6690_sensor.c | 2 +-
drivers/macintosh/windfarm_smu_controls.c | 8 ++++----
drivers/macintosh/windfarm_smu_sat.c | 8 ++++----
drivers/macintosh/windfarm_smu_sensors.c | 6 +++---
15 files changed, 35 insertions(+), 35 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index d562160..b468d6d 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -175,7 +175,7 @@ static int macio_uevent(struct device *dev, char **envp, int num_envp,
* it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */
- compat = get_property(of->node, "compatible", &cplen);
+ compat = of_get_property(of->node, "compatible", &cplen);
compat2 = compat;
cplen2= cplen;
while (compat && cplen > 0) {
@@ -491,7 +491,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
#endif
MAX_NODE_NAME_SIZE, np->name);
} else {
- reg = get_property(np, "reg", NULL);
+ reg = of_get_property(np, "reg", NULL);
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 8566bdf..3197f81 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
int length = 0;
of = &to_macio_device (dev)->ofdev;
- compat = get_property(of->node, "compatible", &cplen);
+ compat = of_get_property(of->node, "compatible", &cplen);
if (!compat) {
*buf = '\0';
return 0;
@@ -47,7 +47,7 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
int length;
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;
length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type);
buf += length;
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index f83fad2..4177ff0 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -387,7 +387,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
if (strcmp(np->name, "lightshow") == 0)
break;
if ((strcmp(np->name, "sound") == 0) &&
- get_property(np, "virtual", NULL) != NULL)
+ of_get_property(np, "virtual", NULL) != NULL)
break;
}
if (np == NULL) {
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 45bb3c1..135f22e 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -491,7 +491,7 @@ int __init smu_init (void)
printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
goto fail;
}
- data = get_property(smu->db_node, "reg", NULL);
+ data = of_get_property(smu->db_node, "reg", NULL);
if (data == NULL) {
of_node_put(smu->db_node);
smu->db_node = NULL;
@@ -512,7 +512,7 @@ int __init smu_init (void)
smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
if (smu->msg_node == NULL)
break;
- data = get_property(smu->msg_node, "reg", NULL);
+ data = of_get_property(smu->msg_node, "reg", NULL);
if (data == NULL) {
of_node_put(smu->msg_node);
smu->msg_node = NULL;
@@ -1004,7 +1004,7 @@ const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
} else
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) {
DPRINTK("trying to extract from SMU ...\n");
part = smu_create_sdb_partition(id);
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index a7ce559..2289034 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -567,13 +567,13 @@ thermostat_init(void)
else
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,
(*prop == 1)?"":"un");
if (*prop != 1)
return -ENODEV;
- prop = get_property(np, "reg", NULL);
+ prop = of_get_property(np, "reg", NULL);
if (!prop)
return -ENODEV;
@@ -591,9 +591,9 @@ thermostat_init(void)
"limit_adjust: %d, fan_speed: %d\n",
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++) {
- sensor_location[i] = get_property(np,
+ sensor_location[i] = of_get_property(np,
"hwsensor-location", NULL) + offset;
if (sensor_location[i] == NULL)
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 2e4ad44..78ff186 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -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");
return -ENODEV;
}
- data = get_property(np, "cpuid", &len);
+ data = of_get_property(np, "cpuid", &len);
if (data == NULL) {
printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n");
of_node_put(np);
@@ -1337,7 +1337,7 @@ static int init_backside_state(struct backside_pid_state *state)
*/
u3 = of_find_node_by_path("/u3@0,f8000000");
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) & 0x3f) < 0x34)
u3h = 0;
@@ -2129,8 +2129,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
continue;
/* Lookup for a matching location */
- loc = get_property(np, "location", NULL);
- reg = get_property(np, "reg", NULL);
+ loc = of_get_property(np, "location", NULL);
+ reg = of_get_property(np, "reg", NULL);
if (loc == NULL || reg == NULL)
continue;
DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg);
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index a1d3a98..35233de 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -492,7 +492,7 @@ g4fan_init( void )
if( !(np=of_find_node_by_name(NULL, "power-mgt")) )
return -ENODEV;
- info = get_property(np, "thermal-info", NULL);
+ info = of_get_property(np, "thermal-info", NULL);
of_node_put(np);
if( !info || !machine_is_compatible("PowerMac3,6") )
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index d58fcf6..76d2177 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -131,7 +131,7 @@ int __init find_via_cuda(void)
if (vias == 0)
return 0;
- reg = get_property(vias, "reg", NULL);
+ reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) {
printk(KERN_ERR "via-cuda: No \"reg\" property !\n");
goto fail;
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index ed8423f..eaa7394 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -118,7 +118,7 @@ static int __init via_pmu_led_init(void)
dt = of_find_node_by_path("/");
if (dt == NULL)
return -ENODEV;
- model = get_property(dt, "model", NULL);
+ model = of_get_property(dt, "model", NULL);
if (model == NULL)
return -ENODEV;
if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index ca3c4ab..75623fd 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -289,7 +289,7 @@ int __init find_via_pmu(void)
if (vias == NULL)
return 0;
- reg = get_property(vias, "reg", NULL);
+ reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) {
printk(KERN_ERR "via-pmu: No \"reg\" property !\n");
goto fail;
@@ -331,7 +331,7 @@ int __init find_via_pmu(void)
gpiop = of_find_node_by_name(NULL, "gpio");
if (gpiop) {
- reg = get_property(gpiop, "reg", NULL);
+ reg = of_get_property(gpiop, "reg", NULL);
if (reg)
gaddr = of_translate_address(gpiop, reg);
if (gaddr != OF_BAD_ADDR)
@@ -487,7 +487,7 @@ static int __init via_pmu_dev_init(void)
struct device_node* prim = find_devices("power-mgt");
const u32 *prim_info = NULL;
if (prim)
- prim_info = get_property(prim, "prim-info", NULL);
+ prim_info = of_get_property(prim, "prim-info", NULL);
if (prim_info) {
/* Other stuffs here yet unknown */
pmu_battery_count = (prim_info[6] >> 16) & 0xff;
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index 3f7967f..ab4d1b6 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -176,7 +176,7 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
for (dev = NULL;
(dev = of_get_next_child(busnode, dev)) != NULL;) {
const char *loc =
- get_property(dev, "hwsensor-location", NULL);
+ of_get_property(dev, "hwsensor-location", NULL);
u8 addr;
/* We must re-match the adapter in order to properly check
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c
index eae1189..eaa74af 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -134,7 +134,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
if (!device_is_compatible(dev, "max6690"))
continue;
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)
continue;
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 31b750d..ff398ad 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -167,7 +167,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
if (fct == NULL)
return NULL;
fct->ctrl.ops = &smu_fan_ops;
- l = get_property(node, "location", NULL);
+ l = of_get_property(node, "location", NULL);
if (l == NULL)
goto fail;
@@ -224,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
goto fail;
/* Get min & max values*/
- v = get_property(node, "min-value", NULL);
+ v = of_get_property(node, "min-value", NULL);
if (v == NULL)
goto fail;
fct->min = *v;
- v = get_property(node, "max-value", NULL);
+ v = of_get_property(node, "max-value", NULL);
if (v == NULL)
goto fail;
fct->max = *v;
/* Get "reg" value */
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
if (reg == NULL)
goto fail;
fct->reg = *reg;
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index 83f79de..9a6c2cf 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -241,7 +241,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
char *name;
int vsens[2], isens[2];
- reg = get_property(dev, "reg", NULL);
+ reg = of_get_property(dev, "reg", NULL);
if (reg == NULL)
return;
addr = *reg;
@@ -268,9 +268,9 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
isens[0] = isens[1] = -1;
child = NULL;
while ((child = of_get_next_child(dev, child)) != NULL) {
- reg = get_property(child, "reg", NULL);
- type = get_property(child, "device_type", NULL);
- loc = get_property(child, "location", NULL);
+ reg = of_get_property(child, "reg", NULL);
+ type = of_get_property(child, "device_type", NULL);
+ loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL)
continue;
diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c
index 01b4c50..9c567b9 100644
--- a/drivers/macintosh/windfarm_smu_sensors.c
+++ b/drivers/macintosh/windfarm_smu_sensors.c
@@ -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);
if (ads == NULL)
return NULL;
- c = get_property(node, "device_type", NULL);
- l = get_property(node, "location", NULL);
+ c = of_get_property(node, "device_type", NULL);
+ l = of_get_property(node, "location", NULL);
if (c == NULL || l == NULL)
goto fail;
@@ -255,7 +255,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node)
} else
goto fail;
- v = get_property(node, "reg", NULL);
+ v = of_get_property(node, "reg", NULL);
if (v == NULL)
goto fail;
ads->reg = *v;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 11/17] [POWERPC] Rename get_property to of_get_property: drivers/char
2007-04-03 12:40 ` [PATCH 10/17] [POWERPC] Rename get_property to of_get_property: drivers/macintosh Stephen Rothwell
@ 2007-04-03 12:42 ` Stephen Rothwell
2007-04-03 12:43 ` [PATCH 12/17] [POWERPC] Rename get_property to of_get_property: drivers/net Stephen Rothwell
2007-04-27 3:41 ` [PATCH] [POWERPC] Rename get_property to of_get_property: partial drivers Stephen Rothwell
0 siblings, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:42 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/char/agp/uninorth-agp.c | 2 +-
drivers/char/briq_panel.c | 2 +-
drivers/char/hvc_iseries.c | 2 +-
drivers/char/hvc_vio.c | 2 +-
drivers/char/hvsi.c | 4 ++--
drivers/char/tpm/tpm_atmel.h | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 91b0621..42c0a60 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -613,7 +613,7 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
uninorth_node = of_find_node_by_name(NULL, "u3");
}
if (uninorth_node) {
- const int *revprop = get_property(uninorth_node,
+ const int *revprop = of_get_property(uninorth_node,
"device-rev", NULL);
if (revprop != NULL)
uninorth_rev = *revprop & 0x3f;
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
index 8dcf9d2..669965a 100644
--- a/drivers/char/briq_panel.c
+++ b/drivers/char/briq_panel.c
@@ -206,7 +206,7 @@ static int __init briq_panel_init(void)
const char *machine;
int i;
- machine = get_property(root, "model", NULL);
+ machine = of_get_property(root, "model", NULL);
if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0)
return -ENODEV;
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index f144a94..ec420fe 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -575,7 +575,7 @@ static int hvc_find_vtys(void)
(num_found >= VTTY_PORTS))
break;
- vtermno = get_property(vty, "reg", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno)
continue;
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index f9c0084..94a542e 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -153,7 +153,7 @@ static int hvc_find_vtys(void)
if (num_found >= MAX_NR_HVC_CONSOLES)
break;
- vtermno = get_property(vty, "reg", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno)
continue;
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 50315d6..d5a752d 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void)
struct hvsi_struct *hp;
const uint32_t *vtermno, *irq;
- vtermno = get_property(vty, "reg", NULL);
- irq = get_property(vty, "interrupts", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
+ irq = of_get_property(vty, "interrupts", NULL);
if (!vtermno || !irq)
continue;
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 3c85200..377bc60 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -52,7 +52,7 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
return NULL;
}
- reg = get_property(dn, "reg", ®len);
+ reg = of_get_property(dn, "reg", ®len);
naddrc = of_n_addr_cells(dn);
nsizec = of_n_size_cells(dn);
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 12/17] [POWERPC] Rename get_property to of_get_property: drivers/net
2007-04-03 12:42 ` [PATCH 11/17] [POWERPC] Rename get_property to of_get_property: drivers/char Stephen Rothwell
@ 2007-04-03 12:43 ` Stephen Rothwell
2007-04-03 12:45 ` [PATCH 13/17] [POWERPC] Rename get_property to of_get_property: drivers/video Stephen Rothwell
2007-04-27 3:41 ` [PATCH] [POWERPC] Rename get_property to of_get_property: partial drivers Stephen Rothwell
1 sibling, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:43 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/bmac.c | 5 +++--
drivers/net/ehea/ehea_main.c | 4 ++--
drivers/net/mace.c | 4 ++--
drivers/net/pasemi_mac.c | 2 +-
drivers/net/spider_net.c | 4 ++--
drivers/net/sungem.c | 2 +-
drivers/net/sungem_phy.c | 2 +-
drivers/net/ucc_geth.c | 16 ++++++++--------
8 files changed, 20 insertions(+), 19 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index c143304..aa01ba3 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1261,9 +1261,10 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
return -ENODEV;
}
- prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
+ prop_addr = of_get_property(macio_get_of_node(mdev),
+ "mac-address", NULL);
if (prop_addr == NULL) {
- prop_addr = get_property(macio_get_of_node(mdev),
+ prop_addr = of_get_property(macio_get_of_node(mdev),
"local-mac-address", NULL);
if (prop_addr == NULL) {
printk(KERN_ERR "BMAC: Can't get mac-address\n");
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d1a8134..6d5effd 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2336,7 +2336,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
port->of_dev_node = dn;
/* Determine logical port id */
- dn_log_port_id = get_property(dn, "ibm,hea-port-no", NULL);
+ dn_log_port_id = of_get_property(dn, "ibm,hea-port-no", NULL);
if (!dn_log_port_id) {
ehea_error("bad device node: dn_log_port_id=%p",
@@ -2502,7 +2502,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
goto out;
}
- adapter_handle = get_property(dev->ofdev.node, "ibm,hea-handle",
+ adapter_handle = of_get_property(dev->ofdev.node, "ibm,hea-handle",
NULL);
if (adapter_handle)
adapter->handle = *adapter_handle;
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 9ec24f0..7018ba9 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -110,9 +110,9 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
return -ENODEV;
}
- addr = get_property(mace, "mac-address", NULL);
+ addr = of_get_property(mace, "mac-address", NULL);
if (addr == NULL) {
- addr = get_property(mace, "local-mac-address", NULL);
+ addr = of_get_property(mace, "local-mac-address", NULL);
if (addr == NULL) {
printk(KERN_ERR "Can't get mac-address for MACE %s\n",
mace->full_name);
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index d670ac7..cb7a8e7 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -80,7 +80,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return -ENOENT;
}
- maddr = get_property(dn, "mac-address", NULL);
+ maddr = of_get_property(dn, "mac-address", NULL);
if (maddr == NULL) {
dev_warn(&pdev->dev,
"no mac address in device tree, not configuring\n");
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 3b91af8..6984761 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1831,7 +1831,7 @@ try_host_fw:
if (!dn)
goto out_err;
- fw_prop = get_property(dn, "firmware", &fw_size);
+ fw_prop = of_get_property(dn, "firmware", &fw_size);
if (!fw_prop)
goto out_err;
@@ -2237,7 +2237,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
if (!dn)
return -EIO;
- mac = get_property(dn, "local-mac-address", NULL);
+ mac = of_get_property(dn, "local-mac-address", NULL);
if (!mac)
return -EIO;
memcpy(addr.sa_data, mac, ETH_ALEN);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 616be8d..1d0f5ca 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2900,7 +2900,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
#elif defined(CONFIG_PPC_PMAC)
const unsigned char *addr;
- addr = get_property(gp->of_node, "local-mac-address", NULL);
+ addr = of_get_property(gp->of_node, "local-mac-address", NULL);
if (addr == NULL) {
printk("\n");
printk(KERN_ERR "%s: can't get mac-address\n", dev->name);
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index 56a110c..61843fd 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -451,7 +451,7 @@ static int bcm5421_init(struct mii_phy* phy)
if (phy->platform_data) {
struct device_node *np = of_get_parent(phy->platform_data);
int can_low_power = 1;
- if (np == NULL || get_property(np, "no-autolowpower", NULL))
+ if (np == NULL || of_get_property(np, "no-autolowpower", NULL))
can_low_power = 0;
if (can_low_power) {
/* Enable automatic low-power */
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 639e1e6..12d394f 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -4080,16 +4080,16 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ugeth_vdbg("%s: IN", __FUNCTION__);
- prop = get_property(np, "device-id", NULL);
+ prop = of_get_property(np, "device-id", NULL);
ucc_num = *prop - 1;
if ((ucc_num < 0) || (ucc_num > 7))
return -ENODEV;
ug_info = &ugeth_info[ucc_num];
ug_info->uf_info.ucc_num = ucc_num;
- prop = get_property(np, "rx-clock", NULL);
+ prop = of_get_property(np, "rx-clock", NULL);
ug_info->uf_info.rx_clock = *prop;
- prop = get_property(np, "tx-clock", NULL);
+ prop = of_get_property(np, "tx-clock", NULL);
ug_info->uf_info.tx_clock = *prop;
err = of_address_to_resource(np, 0, &res);
if (err)
@@ -4098,15 +4098,15 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.regs = res.start;
ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
- ph = get_property(np, "phy-handle", NULL);
+ ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL)
return -ENODEV;
- prop = get_property(phy, "reg", NULL);
+ prop = of_get_property(phy, "reg", NULL);
ug_info->phy_address = *prop;
- prop = get_property(phy, "interface", NULL);
+ prop = of_get_property(phy, "interface", NULL);
ug_info->enet_interface = *prop;
ug_info->phy_interrupt = irq_of_parse_and_map(phy, 0);
ug_info->board_flags = (ug_info->phy_interrupt == NO_IRQ)?
@@ -4127,7 +4127,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
/* timing. */
/* The following compensates by writing to the reserved */
/* QE Port Output Hold Registers (CPOH1?). */
- prop = get_property(phy, "interface", NULL);
+ prop = of_get_property(phy, "interface", NULL);
phy_interface = *prop;
if ((phy_interface == ENET_1000_RGMII) ||
(phy_interface == ENET_100_RGMII) ||
@@ -4140,7 +4140,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
soc = of_find_node_by_type(NULL, "soc");
if (soc) {
unsigned int size;
- const void *prop = get_property(soc, "reg", &size);
+ const void *prop = of_get_property(soc, "reg", &size);
immrbase = of_translate_address(soc, prop);
of_node_put(soc);
};
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 13/17] [POWERPC] Rename get_property to of_get_property: drivers/video
2007-04-03 12:43 ` [PATCH 12/17] [POWERPC] Rename get_property to of_get_property: drivers/net Stephen Rothwell
@ 2007-04-03 12:45 ` Stephen Rothwell
2007-04-03 12:46 ` [PATCH 14/17] [POWERPC] Rename get_property to of_get_property: drivers/scsi Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:45 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/video/aty/radeon_base.c | 6 +++---
drivers/video/aty/radeon_monitor.c | 13 +++++++------
drivers/video/aty/radeon_pm.c | 2 +-
drivers/video/nvidia/nv_of.c | 8 ++++----
drivers/video/offb.c | 28 ++++++++++++++--------------
drivers/video/riva/fbdev.c | 4 ++--
6 files changed, 31 insertions(+), 30 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 1bf6f42..4972630 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -422,7 +422,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
if (dp == NULL)
return -ENODEV;
- val = get_property(dp, "ATY,RefCLK", NULL);
+ val = of_get_property(dp, "ATY,RefCLK", NULL);
if (!val || !*val) {
printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
return -EINVAL;
@@ -430,11 +430,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
rinfo->pll.ref_clk = (*val) / 10;
- val = get_property(dp, "ATY,SCLK", NULL);
+ val = of_get_property(dp, "ATY,SCLK", NULL);
if (val && *val)
rinfo->pll.sclk = (*val) / 10;
- val = get_property(dp, "ATY,MCLK", NULL);
+ val = of_get_property(dp, "ATY,MCLK", NULL);
if (val && *val)
rinfo->pll.mclk = (*val) / 10;
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 38c7dbf..ec7a5d4 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -65,12 +65,12 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
"EDID1", "EDID2", NULL };
const u8 *pedid = NULL;
- const u8 *pmt = NULL;
+ const u8 *pmt;
u8 *tmp;
int i, mt = MT_NONE;
RTRACE("analyzing OF properties...\n");
- pmt = get_property(dp, "display-type", NULL);
+ pmt = of_get_property(dp, "display-type", NULL);
if (!pmt)
return MT_NONE;
RTRACE("display-type: %s\n", pmt);
@@ -89,7 +89,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
}
for (i = 0; propnames[i] != NULL; ++i) {
- pedid = get_property(dp, propnames[i], NULL);
+ pedid = of_get_property(dp, propnames[i], NULL);
if (pedid != NULL)
break;
}
@@ -98,9 +98,10 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
* single-head cards have hdno == -1 and skip this step
*/
if (pedid == NULL && dp->parent && (hdno != -1))
- pedid = get_property(dp->parent, (hdno == 0) ? "EDID1" : "EDID2", NULL);
+ pedid = of_get_property(dp->parent,
+ (hdno == 0) ? "EDID1" : "EDID2", NULL);
if (pedid == NULL && dp->parent && (hdno == 0))
- pedid = get_property(dp->parent, "EDID", NULL);
+ pedid = of_get_property(dp->parent, "EDID", NULL);
if (pedid == NULL)
return mt;
@@ -130,7 +131,7 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
do {
if (!dp)
return MT_NONE;
- pname = get_property(dp, "name", NULL);
+ pname = of_get_property(dp, "name", NULL);
if (!pname)
return MT_NONE;
len = strlen(pname);
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c411293..1786ae1 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -1290,7 +1290,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
if (rinfo->of_node != NULL) {
int size;
- mrtable = get_property(rinfo->of_node, "ATY,MRT", &size);
+ mrtable = of_get_property(rinfo->of_node, "ATY,MRT", &size);
if (mrtable)
mrtable_size = size >> 2;
else
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c
index 163a774..73afd7e 100644
--- a/drivers/video/nvidia/nv_of.c
+++ b/drivers/video/nvidia/nv_of.c
@@ -46,15 +46,15 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
for (dp = NULL;
(dp = of_get_next_child(parent, dp)) != NULL;) {
- pname = get_property(dp, "name", NULL);
+ pname = of_get_property(dp, "name", NULL);
if (!pname)
continue;
len = strlen(pname);
if ((pname[len-1] == 'A' && conn == 1) ||
(pname[len-1] == 'B' && conn == 2)) {
for (i = 0; propnames[i] != NULL; ++i) {
- pedid = get_property(dp, propnames[i],
- NULL);
+ pedid = of_get_property(dp,
+ propnames[i], NULL);
if (pedid != NULL)
break;
}
@@ -65,7 +65,7 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
}
if (pedid == NULL) {
for (i = 0; propnames[i] != NULL; ++i) {
- pedid = get_property(parent, propnames[i], NULL);
+ pedid = of_get_property(parent, propnames[i], NULL);
if (pedid != NULL)
break;
}
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 9576a55..3cf603c 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -425,27 +425,27 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
const u32 *pp, *addrp, *up;
u64 asize;
- pp = get_property(dp, "linux,bootx-depth", &len);
+ pp = of_get_property(dp, "linux,bootx-depth", &len);
if (pp == NULL)
- pp = get_property(dp, "depth", &len);
+ pp = of_get_property(dp, "depth", &len);
if (pp && len == sizeof(u32))
depth = *pp;
- pp = get_property(dp, "linux,bootx-width", &len);
+ pp = of_get_property(dp, "linux,bootx-width", &len);
if (pp == NULL)
- pp = get_property(dp, "width", &len);
+ pp = of_get_property(dp, "width", &len);
if (pp && len == sizeof(u32))
width = *pp;
- pp = get_property(dp, "linux,bootx-height", &len);
+ pp = of_get_property(dp, "linux,bootx-height", &len);
if (pp == NULL)
- pp = get_property(dp, "height", &len);
+ pp = of_get_property(dp, "height", &len);
if (pp && len == sizeof(u32))
height = *pp;
- pp = get_property(dp, "linux,bootx-linebytes", &len);
+ pp = of_get_property(dp, "linux,bootx-linebytes", &len);
if (pp == NULL)
- pp = get_property(dp, "linebytes", &len);
+ pp = of_get_property(dp, "linebytes", &len);
if (pp && len == sizeof(u32) && (*pp != 0xffffffffu))
pitch = *pp;
else
@@ -463,9 +463,9 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
* ranges and pick one that is both big enough and if possible encloses
* the "address" property. If none match, we pick the biggest
*/
- up = get_property(dp, "linux,bootx-addr", &len);
+ up = of_get_property(dp, "linux,bootx-addr", &len);
if (up == NULL)
- up = get_property(dp, "address", &len);
+ up = of_get_property(dp, "address", &len);
if (up && len == sizeof(u32))
addr_prop = *up;
@@ -521,7 +521,7 @@ static int __init offb_init(void)
return -ENODEV;
/* Check if we have a MacOS display without a node spec */
- if (get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) {
+ if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) {
/* The old code tried to work out which node was the MacOS
* display based on the address. I'm dropping that since the
* lack of a node spec only happens with old BootX versions
@@ -532,14 +532,14 @@ static int __init offb_init(void)
}
for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
- if (get_property(dp, "linux,opened", NULL) &&
- get_property(dp, "linux,boot-display", NULL)) {
+ if (of_get_property(dp, "linux,opened", NULL) &&
+ of_get_property(dp, "linux,boot-display", NULL)) {
boot_disp = dp;
offb_init_nodriver(dp, 0);
}
}
for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
- if (get_property(dp, "linux,opened", NULL) &&
+ if (of_get_property(dp, "linux,opened", NULL) &&
dp != boot_disp)
offb_init_nodriver(dp, 0);
}
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index d7ece8d..9c6bd09 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1760,13 +1760,13 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
NVTRACE_ENTER();
dp = pci_device_to_OF_node(pd);
for (; dp != NULL; dp = dp->child) {
- disptype = get_property(dp, "display-type", NULL);
+ disptype = of_get_property(dp, "display-type", NULL);
if (disptype == NULL)
continue;
if (strncmp(disptype, "LCD", 3) != 0)
continue;
for (i = 0; propnames[i] != NULL; ++i) {
- pedid = get_property(dp, propnames[i], NULL);
+ pedid = of_get_property(dp, propnames[i], NULL);
if (pedid != NULL) {
par->EDID = (unsigned char *)pedid;
NVTRACE("LCD found.\n");
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 14/17] [POWERPC] Rename get_property to of_get_property: drivers/scsi
2007-04-03 12:45 ` [PATCH 13/17] [POWERPC] Rename get_property to of_get_property: drivers/video Stephen Rothwell
@ 2007-04-03 12:46 ` Stephen Rothwell
2007-04-03 12:49 ` [PATCH 15/17] [POWERPC] Rename get_property to of_get_property: drivers Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:46 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/scsi/ibmvscsi/ibmvstgt.c | 8 ++++----
drivers/scsi/ibmvscsi/rpa_vscsi.c | 4 ++--
drivers/scsi/mac53c94.c | 2 +-
drivers/scsi/mesh.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index f65f21d..3fe831c 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -903,16 +903,16 @@ static int get_system_info(void)
if (!rootdn)
return -ENOENT;
- model = get_property(rootdn, "model", NULL);
- id = get_property(rootdn, "system-id", NULL);
+ model = of_get_property(rootdn, "model", NULL);
+ id = of_get_property(rootdn, "system-id", NULL);
if (model && id)
snprintf(system_id, sizeof(system_id), "%s-%s", model, id);
- name = get_property(rootdn, "ibm,partition-name", NULL);
+ name = of_get_property(rootdn, "ibm,partition-name", NULL);
if (name)
strncpy(partition_name, name, sizeof(partition_name));
- num = get_property(rootdn, "ibm,partition-no", NULL);
+ num = of_get_property(rootdn, "ibm,partition-no", NULL);
if (num)
partition_number = *num;
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index 227c0f2..9bbb69c 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -162,11 +162,11 @@ static void gather_partition_info(void)
return;
}
- ppartition_name = get_property(rootdn, "ibm,partition-name", NULL);
+ ppartition_name = of_get_property(rootdn, "ibm,partition-name", NULL);
if (ppartition_name)
strncpy(partition_name, ppartition_name,
sizeof(partition_name));
- p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL);
+ p_number_ptr = of_get_property(rootdn, "ibm,partition-no", NULL);
if (p_number_ptr)
partition_number = *p_number_ptr;
}
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 753d883..5806ede 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -471,7 +471,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
goto out_free;
}
- clkprop = get_property(node, "clock-frequency", &proplen);
+ clkprop = of_get_property(node, "clock-frequency", &proplen);
if (clkprop == NULL || proplen != sizeof(int)) {
printk(KERN_ERR "%s: can't get clock frequency, "
"assuming 25MHz\n", node->full_name);
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 1fd3c75..cf3666d 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1947,7 +1947,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
ms->tgts[tgt].current_req = NULL;
}
- if ((cfp = get_property(mesh, "clock-frequency", NULL)))
+ if ((cfp = of_get_property(mesh, "clock-frequency", NULL)))
ms->clk_freq = *cfp;
else {
printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 15/17] [POWERPC] Rename get_property to of_get_property: drivers
2007-04-03 12:46 ` [PATCH 14/17] [POWERPC] Rename get_property to of_get_property: drivers/scsi Stephen Rothwell
@ 2007-04-03 12:49 ` Stephen Rothwell
2007-04-03 12:50 ` [PATCH 16/17] [POWERPC] Rename get_property to of_get_property: the last one Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:49 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/ata/sata_svw.c | 2 +-
drivers/hwmon/ams/ams-core.c | 2 +-
drivers/hwmon/ams/ams-i2c.c | 2 +-
drivers/hwmon/ams/ams-pmu.c | 2 +-
drivers/ide/ppc/pmac.c | 4 ++--
drivers/infiniband/hw/ehca/ehca_main.c | 2 +-
drivers/mtd/maps/physmap_of.c | 8 ++++----
drivers/pci/hotplug/rpaphp_core.c | 10 +++++-----
drivers/serial/mpc52xx_uart.c | 2 +-
drivers/serial/of_serial.c | 4 ++--
drivers/serial/pmac_zilog.c | 6 +++---
11 files changed, 22 insertions(+), 22 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index b121195..3e56211 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -297,7 +297,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
/* Match it to a port node */
index = (ap == ap->host->ports[0]) ? 0 : 1;
for (np = np->child; np != NULL; np = np->sibling) {
- const u32 *reg = get_property(np, "reg", NULL);
+ const u32 *reg = of_get_property(np, "reg", NULL);
if (!reg)
continue;
if (index == *reg)
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
index f5ebad5..93b963f 100644
--- a/drivers/hwmon/ams/ams-core.c
+++ b/drivers/hwmon/ams/ams-core.c
@@ -144,7 +144,7 @@ int ams_sensor_attach(void)
const u32 *prop;
/* Get orientation */
- prop = get_property(ams_info.of_node, "orientation", NULL);
+ prop = of_get_property(ams_info.of_node, "orientation", NULL);
if (!prop)
return -ENODEV;
ams_info.orient1 = *prop;
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
index 485d333..ccd5cef 100644
--- a/drivers/hwmon/ams/ams-i2c.c
+++ b/drivers/hwmon/ams/ams-i2c.c
@@ -276,7 +276,7 @@ int __init ams_i2c_init(struct device_node *np)
ams_info.bustype = BUS_I2C;
/* look for bus either using "reg" or by path */
- prop = get_property(ams_info.of_node, "reg", NULL);
+ prop = of_get_property(ams_info.of_node, "reg", NULL);
if (!prop) {
result = -ENODEV;
diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
index 1b01c21..9463e97 100644
--- a/drivers/hwmon/ams/ams-pmu.c
+++ b/drivers/hwmon/ams/ams-pmu.c
@@ -160,7 +160,7 @@ int __init ams_pmu_init(struct device_node *np)
ams_info.bustype = BUS_HOST;
/* Get PMU command, should be 0x4e, but we can never know */
- prop = get_property(ams_info.of_node, "reg", NULL);
+ prop = of_get_property(ams_info.of_node, "reg", NULL);
if (!prop) {
result = -ENODEV;
goto exit;
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 071a030..774bfd3 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1175,14 +1175,14 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
pmif->broken_dma = 1;
}
- bidp = get_property(np, "AAPL,bus-id", NULL);
+ bidp = of_get_property(np, "AAPL,bus-id", NULL);
pmif->aapl_bus_id = bidp ? *bidp : 0;
/* Get cable type from device-tree */
if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6
|| pmif->kind == controller_k2_ata6
|| pmif->kind == controller_sh_ata6) {
- const char* cable = get_property(np, "cable-type", NULL);
+ const char* cable = of_get_property(np, "cable-type", NULL);
if (cable && !strncmp(cable, "80-", 3))
pmif->cable_80 = 1;
}
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index cee66b7..e5c2bcc 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -569,7 +569,7 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev,
struct ib_pd *ibpd;
int ret;
- handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
+ handle = of_get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
if (!handle) {
ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
dev->ofdev.node->full_name);
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 7efe744..72107dc 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -48,7 +48,7 @@ static int parse_flash_partitions(struct device_node *node,
const u32 *part;
const char *name;
- part = get_property(node, "partitions", &plen);
+ part = of_get_property(node, "partitions", &plen);
if (part == NULL)
goto err;
@@ -59,7 +59,7 @@ static int parse_flash_partitions(struct device_node *node,
goto err;
}
- name = get_property(node, "partition-names", &plen);
+ name = of_get_property(node, "partition-names", &plen);
for (i = 0; i < retval; i++) {
(*parts)[i].offset = *part++;
@@ -153,7 +153,7 @@ static int __devinit of_physmap_probe(struct of_device *dev, const struct of_dev
goto err_out;
}
- width = get_property(dp, "bank-width", NULL);
+ width = of_get_property(dp, "bank-width", NULL);
if (width == NULL) {
dev_err(&dev->dev, "Can't get the flash bank width!\n");
err = -EINVAL;
@@ -174,7 +174,7 @@ static int __devinit of_physmap_probe(struct of_device *dev, const struct of_dev
simple_map_init(&info->map);
- of_probe = get_property(dp, "probe-type", NULL);
+ of_probe = of_get_property(dp, "probe-type", NULL);
if (of_probe == NULL) {
probe_type = rom_probe_types;
for (; info->mtd == NULL && *probe_type != NULL; probe_type++)
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 71a2cb8..353da5b 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -182,10 +182,10 @@ static int get_children_props(struct device_node *dn, const int **drc_indexes,
{
const int *indexes, *names, *types, *domains;
- indexes = get_property(dn, "ibm,drc-indexes", NULL);
- names = get_property(dn, "ibm,drc-names", NULL);
- types = get_property(dn, "ibm,drc-types", NULL);
- domains = get_property(dn, "ibm,drc-power-domains", NULL);
+ indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
+ names = of_get_property(dn, "ibm,drc-names", NULL);
+ types = of_get_property(dn, "ibm,drc-types", NULL);
+ domains = of_get_property(dn, "ibm,drc-power-domains", NULL);
if (!indexes || !names || !types || !domains) {
/* Slot does not have dynamically-removable children */
@@ -218,7 +218,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
char *name_tmp, *type_tmp;
int i, rc;
- my_index = get_property(dn, "ibm,my-drc-index", NULL);
+ my_index = of_get_property(dn, "ibm,my-drc-index", NULL);
if (!my_index) {
/* Node isn't DLPAR/hotplug capable */
return -EINVAL;
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 8d24cd5..f8c1761 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -1069,7 +1069,7 @@ mpc52xx_uart_of_enumerate(void)
continue;
/* Is a particular device number requested? */
- devno = get_property(np, "port-number", NULL);
+ devno = of_get_property(np, "port-number", NULL);
mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
}
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 09b0b73..e7928fe 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -29,8 +29,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
int ret;
memset(port, 0, sizeof *port);
- spd = get_property(np, "current-speed", NULL);
- clk = get_property(np, "clock-frequency", NULL);
+ spd = of_get_property(np, "current-speed", NULL);
+ clk = of_get_property(np, "clock-frequency", NULL);
if (!clk) {
dev_warn(&ofdev->dev, "no clock-frequency property set\n");
return -ENODEV;
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index 752ef07..2b163c5 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -1452,12 +1452,12 @@ no_dma:
*/
if (device_is_compatible(np, "cobalt"))
uap->flags |= PMACZILOG_FLAG_IS_INTMODEM;
- conn = get_property(np, "AAPL,connector", &len);
+ conn = of_get_property(np, "AAPL,connector", &len);
if (conn && (strcmp(conn, "infrared") == 0))
uap->flags |= PMACZILOG_FLAG_IS_IRDA;
uap->port_type = PMAC_SCC_ASYNC;
/* 1999 Powerbook G3 has slot-names property instead */
- slots = get_property(np, "slot-names", &len);
+ slots = of_get_property(np, "slot-names", &len);
if (slots && slots->count > 0) {
if (strcmp(slots->name, "IrDA") == 0)
uap->flags |= PMACZILOG_FLAG_IS_IRDA;
@@ -1470,7 +1470,7 @@ no_dma:
struct device_node* i2c_modem = find_devices("i2c-modem");
if (i2c_modem) {
const char* mid =
- get_property(i2c_modem, "modem-id", NULL);
+ of_get_property(i2c_modem, "modem-id", NULL);
if (mid) switch(*mid) {
case 0x04 :
case 0x05 :
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 16/17] [POWERPC] Rename get_property to of_get_property: the last one
2007-04-03 12:49 ` [PATCH 15/17] [POWERPC] Rename get_property to of_get_property: drivers Stephen Rothwell
@ 2007-04-03 12:50 ` Stephen Rothwell
2007-04-03 12:52 ` [PATCH 17/17] [POWERPC] Remove get_property Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:50 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
This also fixes a bug where a property value was being modified
in place.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/cell/cbe_cpufreq.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c
index a3850fd..9c5d63b 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -126,7 +126,8 @@ static int set_pmode(int cpu, unsigned int pmode)
static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy)
{
- u32 *max_freq;
+ const u32 *max_freqp;
+ u32 max_freq;
int i, cur_pmode;
struct device_node *cpu;
@@ -137,20 +138,20 @@ static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy)
pr_debug("init cpufreq on CPU %d\n", policy->cpu);
- max_freq = (u32*) get_property(cpu, "clock-frequency", NULL);
+ max_freqp = of_get_property(cpu, "clock-frequency", NULL);
- if(!max_freq)
+ if (!max_freqp)
return -EINVAL;
// we need the freq in kHz
- *max_freq /= 1000;
+ max_freq = *max_freqp / 1000;
- pr_debug("max clock-frequency is at %u kHz\n", *max_freq);
+ pr_debug("max clock-frequency is at %u kHz\n", max_freq);
pr_debug("initializing frequency table\n");
// initialize frequency table
for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) {
- cbe_freqs[i].frequency = *max_freq / cbe_freqs[i].index;
+ cbe_freqs[i].frequency = max_freq / cbe_freqs[i].index;
pr_debug("%d: %d\n", i, cbe_freqs[i].frequency);
}
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 17/17] [POWERPC] Remove get_property
2007-04-03 12:50 ` [PATCH 16/17] [POWERPC] Rename get_property to of_get_property: the last one Stephen Rothwell
@ 2007-04-03 12:52 ` Stephen Rothwell
2007-04-03 13:05 ` [PATCH] [SPARC/64] " Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 12:52 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, David S. Miller
All the uses have been renamed.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/prom.h | 1 -
include/asm-ppc/prom.h | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index e73a2b4..12fa0c4 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -169,7 +169,6 @@ extern int machine_is_compatible(const char *compat);
extern const void *of_get_property(const struct device_node *node,
const char *name,
int *lenp);
-#define get_property(a, b, c) of_get_property((a), (b), (c))
extern void print_properties(struct device_node *node);
extern int of_n_addr_cells(struct device_node* np);
extern int of_n_size_cells(struct device_node* np);
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index 901f7fa..71f4c99 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -35,7 +35,6 @@ extern unsigned long sub_reloc_offset(unsigned long);
#define machine_is_compatible(x) 0
#define of_find_compatible_node(f, t, c) NULL
#define of_get_property(p, n, l) NULL
-#define get_property(a, b, c) of_get_property((a), (b), (c))
#endif /* _PPC_PROM_H */
#endif /* __KERNEL__ */
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH] [SPARC/64] Remove get_property
2007-04-03 12:52 ` [PATCH 17/17] [POWERPC] Remove get_property Stephen Rothwell
@ 2007-04-03 13:05 ` Stephen Rothwell
2007-04-03 13:24 ` [PATCH] [SPARC/64] Make device_node name and type const Stephen Rothwell
2007-04-12 21:42 ` [PATCH] [SPARC/64] Remove get_property David Miller
0 siblings, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 13:05 UTC (permalink / raw)
To: David S. Miller; +Cc: ppc-dev, paulus
All the usages have been renamed to of_get_property.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-sparc/prom.h | 1 -
include/asm-sparc64/prom.h | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
Hi Dave,
If you take the curent powerpc tree (commit
1b56c1da9eec35c610fa2168d754ce567615a6ee) and apply all the patches I
sent today (1-6 then 1-17) then merge that with your current for-2.6.22
tree (commit ab571e3091f055b0f8648822e11ee6413993f899), then you can
apply this. :-)
I did a test sparc64 allmodconfig build (and it get as far as can be
expected :-))
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 39ad222..030461d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -93,7 +93,6 @@ extern int of_device_is_compatible(const struct device_node *device,
extern const void *of_get_property(const struct device_node *node,
const char *name,
int *lenp);
-#define get_property(node,name,lenp) of_get_property(node,name,lenp)
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern int of_getintprop_default(struct device_node *np,
const char *name,
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 6394bd1..dd0a6cd 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -101,7 +101,6 @@ extern int of_device_is_compatible(const struct device_node *device,
extern const void *of_get_property(const struct device_node *node,
const char *name,
int *lenp);
-#define get_property(node,name,lenp) of_get_property(node,name,lenp)
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern int of_getintprop_default(struct device_node *np,
const char *name,
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH] [SPARC/64] Make device_node name and type const
2007-04-03 13:05 ` [PATCH] [SPARC/64] " Stephen Rothwell
@ 2007-04-03 13:24 ` Stephen Rothwell
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
2007-04-12 21:41 ` [PATCH] [SPARC/64] Make device_node name and type const David Miller
2007-04-12 21:42 ` [PATCH] [SPARC/64] Remove get_property David Miller
1 sibling, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-03 13:24 UTC (permalink / raw)
To: David S. Miller; +Cc: ppc-dev, paulus
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-sparc/prom.h | 4 ++--
include/asm-sparc64/prom.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
This produces no new warnings or errors for a sparc64 allmodconfig build.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 030461d..c239a80 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -35,8 +35,8 @@ struct property {
};
struct device_node {
- char *name;
- char *type;
+ const char *name;
+ const char *type;
phandle node;
char *path_component_name;
char *full_name;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index dd0a6cd..88e62cc 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -36,8 +36,8 @@ struct property {
struct of_irq_controller;
struct device_node {
- char *name;
- char *type;
+ const char *name;
+ const char *type;
phandle node;
char *path_component_name;
char *full_name;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 0:58 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Stephen Rothwell
2007-04-03 3:37 ` David Miller
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
@ 2007-04-03 15:39 ` Segher Boessenkool
2007-04-03 18:28 ` David Miller
2 siblings, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-03 15:39 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
Why? It should logically be an u8 * (and nothing
should ever cast it to anything else, accessor
functions should be used instead to get 32-bit ints
from it, etc.)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 3:37 ` David Miller
@ 2007-04-03 15:40 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-03 15:40 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus, sfr
> Stephen, thanks for continuing to work on this OFW code sharing stuff,
> I very much appreciate it!
I second that. Thanks Stephen!
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
2007-04-03 12:26 ` [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel Stephen Rothwell
@ 2007-04-03 17:36 ` Olof Johansson
2007-04-05 1:49 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 109+ messages in thread
From: Olof Johansson @ 2007-04-03 17:36 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Tue, Apr 03, 2007 at 10:24:06PM +1000, Stephen Rothwell wrote:
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> include/asm-powerpc/parport.h | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> This set of patches follows the previous 6. The whole lot have been
> built with allmodconfig on PowerPC64.
Why split this up in 17 patches? It's just a search and replace, might
as well do it as one patch. I don't think there's much use in being able
to bisect halfway through it.
-Olof
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 15:39 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Segher Boessenkool
@ 2007-04-03 18:28 ` David Miller
2007-04-04 11:11 ` Segher Boessenkool
0 siblings, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-03 18:28 UTC (permalink / raw)
To: segher; +Cc: sfr, paulus, linuxppc-dev
From: Segher Boessenkool <segher@kernel.crashing.org>
Date: Tue, 3 Apr 2007 17:39:52 +0200
> Why? It should logically be an u8 * (and nothing
> should ever cast it to anything else, accessor
> functions should be used instead to get 32-bit ints
> from it, etc.)
Ummm, no.
There are structures there, and other types of objects.
Look at how some of the sparc64 code does this, it's not a "u8 *" by
even the largest stretch of the imagination.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-03 18:28 ` David Miller
@ 2007-04-04 11:11 ` Segher Boessenkool
2007-04-04 19:21 ` David Miller
0 siblings, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-04 11:11 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus, sfr
>> Why? It should logically be an u8 * (and nothing
>> should ever cast it to anything else, accessor
>> functions should be used instead to get 32-bit ints
>> from it, etc.)
>
> Ummm, no.
>
> There are structures there, and other types of objects.
There are arrays of bytes there, with no guarantee of
any further alignment.
> Look at how some of the sparc64 code does this, it's not a "u8 *" by
> even the largest stretch of the imagination.
Maybe sparc64 does have some defined extra alignment;
on PowerPC, we get that alignment by making a copy of
the device tree. That means no further interaction
with OF after very early boot (even before the kernel
proper starts); a less than desirable situation, and
certainly not something that a *generic* Linux OF
interface can require. Also, in principle anyway,
you can have an integer follow a string in the same
property.
So just do an of_decode_int() and its cousins -- platforms
that are trying to guarantee alignment, or that can handle
unaligned memory accesses, can just define these as direct
accesses; everyone else should use the read-by-byte sequences.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-04 11:11 ` Segher Boessenkool
@ 2007-04-04 19:21 ` David Miller
2007-04-05 1:48 ` Benjamin Herrenschmidt
2007-04-05 18:12 ` Segher Boessenkool
0 siblings, 2 replies; 109+ messages in thread
From: David Miller @ 2007-04-04 19:21 UTC (permalink / raw)
To: segher; +Cc: linuxppc-dev, paulus, sfr
From: Segher Boessenkool <segher@kernel.crashing.org>
Date: Wed, 4 Apr 2007 13:11:43 +0200
> >> Why? It should logically be an u8 * (and nothing
> >> should ever cast it to anything else, accessor
> >> functions should be used instead to get 32-bit ints
> >> from it, etc.)
> >
> > Ummm, no.
> >
> > There are structures there, and other types of objects.
>
> There are arrays of bytes there, with no guarantee of
> any further alignment.
On PowerPC misaligned data doesn't generate exceptions, the chip works
it out transparently. It's not very slow at it even, and these paths
accessing this stuff aren't performance critical anyways.
On sparc everything is aligned. I know, I've been accessing OFW data
structures for more than 10 years and I haven't gotten one unaligned
trap on sparc yet.
> So just do an of_decode_int() and its cousins -- platforms
> that are trying to guarantee alignment, or that can handle
> unaligned memory accesses, can just define these as direct
> accesses; everyone else should use the read-by-byte sequences.
No, that's just stupid. Peppering simple accesses to properties
with these wrappers is just going to make the code uglier for
no tangible gain whatsoever.
There is no reason to make a mountain out of a mole hill wrt. this
stuff.
And besides what Stephen is doing is just extending existing
practice, he isn't changing how any of this stuff is already
used. So this discussion should not get in the way of his
patches getting installed.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-04 19:21 ` David Miller
@ 2007-04-05 1:48 ` Benjamin Herrenschmidt
2007-04-05 18:12 ` Segher Boessenkool
1 sibling, 0 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-05 1:48 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus, sfr
> No, that's just stupid. Peppering simple accesses to properties
> with these wrappers is just going to make the code uglier for
> no tangible gain whatsoever.
>
> There is no reason to make a mountain out of a mole hill wrt. this
> stuff.
>
> And besides what Stephen is doing is just extending existing
> practice, he isn't changing how any of this stuff is already
> used. So this discussion should not get in the way of his
> patches getting installed.
/me very much agrees.
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
2007-04-03 12:26 ` [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel Stephen Rothwell
2007-04-03 17:36 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Olof Johansson
@ 2007-04-05 1:49 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-05 1:49 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Tue, 2007-04-03 at 22:24 +1000, Stephen Rothwell wrote:
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(to all of the patches in this serie)
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-04 19:21 ` David Miller
2007-04-05 1:48 ` Benjamin Herrenschmidt
@ 2007-04-05 18:12 ` Segher Boessenkool
2007-04-05 23:01 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-05 18:12 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus, sfr
> On PowerPC misaligned data doesn't generate exceptions, the chip works
> it out transparently.
That's not true. _Most_ chips will in _most_ cases
handle unaligned accesses, unless you have disabled
that. You cannot depend on it working without taking
alignment exceptions.
> On sparc everything is aligned. I know, I've been accessing OFW data
> structures for more than 10 years and I haven't gotten one unaligned
> trap on sparc yet.
It tends to work in practice, sure. Nothing gives you
any guarantee it will, though.
>> So just do an of_decode_int() and its cousins -- platforms
>> that are trying to guarantee alignment, or that can handle
>> unaligned memory accesses, can just define these as direct
>> accesses; everyone else should use the read-by-byte sequences.
>
> No, that's just stupid. Peppering simple accesses to properties
> with these wrappers is just going to make the code uglier for
> no tangible gain whatsoever.
It would remove the millions of casts (and the need for the GCC
-fstrict-aliasing flag for this code).
> And besides what Stephen is doing is just extending existing
> practice, he isn't changing how any of this stuff is already
> used. So this discussion should not get in the way of his
> patches getting installed.
I agree. However when making this code more generally useful,
it would be good to make it more correct at the same time, since
it will only get harder to do so later on.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-05 18:12 ` Segher Boessenkool
@ 2007-04-05 23:01 ` Benjamin Herrenschmidt
2007-04-05 23:12 ` David Miller
2007-04-05 23:26 ` Segher Boessenkool
0 siblings, 2 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-05 23:01 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, paulus, David Miller, sfr
> It would remove the millions of casts (and the need for the GCC
> -fstrict-aliasing flag for this code).
Ugh ? We don't need casts with void *, that's the whole point ... while
we would do if we used char * ...
I'm not familiar with the details of the strict-breaking-good-programs
rules also known as strict-aliasing but isn't void * supposed to alias
all ? if not, that's really stupid... But even then, I fail to see how
this would break an aliasing rule as we aren't accessing the same object
from two different types and we aren't even writing to it.
> I agree. However when making this code more generally useful,
> it would be good to make it more correct at the same time, since
> it will only get harder to do so later on.
I think it's perfectly correct with void * ...
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-05 23:01 ` Benjamin Herrenschmidt
@ 2007-04-05 23:12 ` David Miller
2007-04-05 23:26 ` Segher Boessenkool
1 sibling, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-05 23:12 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, paulus, sfr
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Fri, 06 Apr 2007 09:01:47 +1000
> > I agree. However when making this code more generally useful,
> > it would be good to make it more correct at the same time, since
> > it will only get harder to do so later on.
>
> I think it's perfectly correct with void * ...
Me too. Let's drop this discussion, it's pointless.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-05 23:01 ` Benjamin Herrenschmidt
2007-04-05 23:12 ` David Miller
@ 2007-04-05 23:26 ` Segher Boessenkool
2007-04-09 18:20 ` Paul Mackerras
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-05 23:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus, David Miller, sfr
>> It would remove the millions of casts (and the need for the GCC
>> -fstrict-aliasing flag for this code).
>
> Ugh ? We don't need casts with void *, that's the whole point ... while
> we would do if we used char * ...
>
> I'm not familiar with the details of the strict-breaking-good-programs
> rules also known as strict-aliasing but isn't void * supposed to alias
> all ?
Pointers never alias anything. It's the data accesses
that matter. You cannot access one type as another type
and expect it to work (unless one of those types is a
character type); that's the one simple rule.
Since you cannot access something with type "void"; no,
void pointers don't "alias" anything.
Perhaps you mean that you can cast any pointer to data to
"void *" and back to the same type.
> if not, that's really stupid... But even then, I fail to see how
> this would break an aliasing rule as we aren't accessing the same
> object
> from two different types and we aren't even writing to it.
It doesn't matter whether you write to anything; you cannot
read the same data as two different types, either.
I'll have to trust you that the current code never does
that; it's really hard to see, with all the pointer casting
going around.
>> I agree. However when making this code more generally useful,
>> it would be good to make it more correct at the same time, since
>> it will only get harder to do so later on.
>
> I think it's perfectly correct with void * ...
There's nothing wrong with a void * /per se/. It's that
you need to cast it again later to access your data; and
I say you cast it to all kinds of wrong types, only u8 *
would be valid. Feel free to ignore me though, at least
the PowerPC early boot makes sure all properties are
aligned to some power of two; as long as you never happen
to find a property where an int starts somewhere else
than a multiple of four into that property you should be
fine. And SPARC can keep on depending on the OF it runs
on aligning everything by pure luck as far as I am concerned.
Other architectures won't be so lucky, so we'll just revisit
this when support for those is added.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-05 23:26 ` Segher Boessenkool
@ 2007-04-09 18:20 ` Paul Mackerras
2007-04-09 22:11 ` Segher Boessenkool
2007-04-09 23:17 ` David Miller
0 siblings, 2 replies; 109+ messages in thread
From: Paul Mackerras @ 2007-04-09 18:20 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: sfr, David Miller, linuxppc-dev
Segher Boessenkool writes:
> Pointers never alias anything. It's the data accesses
> that matter. You cannot access one type as another type
> and expect it to work (unless one of those types is a
> character type); that's the one simple rule.
This is true according to the standard (as I understand it), and also
a classic example of the C standards committee stuffing up the C
language by trying to turn it into a "high-level" language. From the
earliest days of C on the PDP-11 it was understood that memory was an
array of bytes which could be addressed and interpreted in any way the
programmer chose. For systems programming tasks that is a very useful
facility, and one which the kernel code generally assumes. It's a
pity IMHO that the committee chose to throw that away (and yes I
understand that throwing it away makes more optimization opportunities
available).
Paul.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-09 18:20 ` Paul Mackerras
@ 2007-04-09 22:11 ` Segher Boessenkool
2007-04-09 23:17 ` David Miller
1 sibling, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-09 22:11 UTC (permalink / raw)
To: Paul Mackerras; +Cc: sfr, David Miller, linuxppc-dev
>> Pointers never alias anything. It's the data accesses
>> that matter. You cannot access one type as another type
>> and expect it to work (unless one of those types is a
>> character type); that's the one simple rule.
>
> This is true according to the standard (as I understand it), and also
> a classic example of the C standards committee stuffing up the C
> language by trying to turn it into a "high-level" language. From the
> earliest days of C on the PDP-11 it was understood that memory was an
> array of bytes which could be addressed and interpreted in any way the
> programmer chose. For systems programming tasks that is a very useful
> facility, and one which the kernel code generally assumes. It's a
> pity IMHO that the committee chose to throw that away (and yes I
> understand that throwing it away makes more optimization opportunities
> available).
You can still access an array of character type as any type
you want. What you *cannot* validly do is store one type, and
read it back as another type, without going through a character
type (or, in the case of GCC, a union).
I don't see there are so many places in the kernel where
it would be useful to do this, and the few places where it
actually is useful or needed should stick out like a sore
thumb and can be easily coded "around" using GCC-specific
compiler facilities.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] [POWERPC] make struct property's value a void *
2007-04-09 18:20 ` Paul Mackerras
2007-04-09 22:11 ` Segher Boessenkool
@ 2007-04-09 23:17 ` David Miller
1 sibling, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-09 23:17 UTC (permalink / raw)
To: paulus; +Cc: sfr, linuxppc-dev
From: Paul Mackerras <paulus@samba.org>
Date: Tue, 10 Apr 2007 04:20:22 +1000
> This is true according to the standard (as I understand it), and also
> a classic example of the C standards committee stuffing up the C
> language by trying to turn it into a "high-level" language. From the
> earliest days of C on the PDP-11 it was understood that memory was an
> array of bytes which could be addressed and interpreted in any way the
> programmer chose. For systems programming tasks that is a very useful
> facility, and one which the kernel code generally assumes. It's a
> pity IMHO that the committee chose to throw that away (and yes I
> understand that throwing it away makes more optimization opportunities
> available).
To be honest I think they did the right thing.
99,999,999,999 times out of 100,000,000,000 independant pointers do
not alias each other at all.
But regardless of what one thinks, we don't enable strict aliasing in
the kernel build anyways, so none of this even matters for us.
^ permalink raw reply [flat|nested] 109+ messages in thread
* [PATCH,RFC] Split out common parts of prom.h
2007-04-03 13:24 ` [PATCH] [SPARC/64] Make device_node name and type const Stephen Rothwell
@ 2007-04-12 4:19 ` Stephen Rothwell
2007-04-12 4:25 ` David Miller
` (2 more replies)
2007-04-12 21:41 ` [PATCH] [SPARC/64] Make device_node name and type const David Miller
1 sibling, 3 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-12 4:19 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This creates linux/openfw.h and includes asm/prom.h from it.
We also include linux/openfw.h from asm/prom.h while we transition.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/prom.h | 39 +++-------------------------
include/asm-sparc/prom.h | 48 ++++-------------------------------
include/asm-sparc64/prom.h | 48 ++++-------------------------------
include/linux/openfw.h | 59 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+), 118 deletions(-)
create mode 100644 include/linux/openfw.h
This applies on top of all the previous patches I sent (including a merge
of the sparc64 and powerpc for-2.6.22 trees). So if people can't get it
to apply, at least I would like some comments on the direction. (I told
Rusty about the circular inclusion below and he didn't throw up, so I
figure it isn't too bad as a temporary measure.)
I have built allmodconfig (modified slightly) for Powerpc, Sparc64 and
Sparc. (All of which fail during the module post processing but for
reasons not related to these patches as far as I can see.)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 12fa0c4..cc85c7f 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -97,12 +97,6 @@ struct device_node {
extern struct device_node *of_chosen;
-/* flag descriptions */
-#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
-
-#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
-#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
-
#define HAVE_ARCH_DEVTREE_FIXUPS
static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
@@ -120,27 +114,7 @@ extern struct device_node *find_compatible_devices(const char *type,
extern struct device_node *find_all_nodes(void);
/* New style node lookup */
-extern struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name);
-#define for_each_node_by_name(dn, name) \
- for (dn = of_find_node_by_name(NULL, name); dn; \
- dn = of_find_node_by_name(dn, name))
-extern struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type);
-#define for_each_node_by_type(dn, type) \
- for (dn = of_find_node_by_type(NULL, type); dn; \
- dn = of_find_node_by_type(dn, type))
-extern struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compat);
-extern struct device_node *of_find_node_by_path(const char *path);
-extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_find_all_nodes(struct device_node *prev);
-extern struct device_node *of_get_parent(const struct device_node *node);
-extern struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev);
-extern struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp);
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
@@ -162,16 +136,9 @@ extern void of_detach_node(const struct device_node *);
extern void finish_device_tree(void);
extern void unflatten_device_tree(void);
extern void early_init_devtree(void *);
-extern int of_device_is_compatible(const struct device_node *device,
- const char *);
#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
extern int machine_is_compatible(const char *compat);
-extern const void *of_get_property(const struct device_node *node,
- const char *name,
- int *lenp);
extern void print_properties(struct device_node *node);
-extern int of_n_addr_cells(struct device_node* np);
-extern int of_n_size_cells(struct device_node* np);
extern int prom_n_intr_cells(struct device_node* np);
extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
extern int prom_add_property(struct device_node* np, struct property* prop);
@@ -225,7 +192,6 @@ static inline unsigned long of_read_ulong(const u32 *cell, int size)
/* Translate an OF address block into a CPU physical address
*/
-#define OF_BAD_ADDR ((u64)-1)
extern u64 of_translate_address(struct device_node *np, const u32 *addr);
/* Extract an address from a device, returns the region size and
@@ -354,6 +320,11 @@ static inline int of_irq_to_resource(struct device_node *dev, int index, struct
return irq;
}
+/*
+ * NB: This is here while we transition from using asm/prom.h
+ * to linux/openfw.h
+ */
+#include <linux/openfw.h>
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index c239a80..5188852 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -2,7 +2,6 @@
#define _SPARC_PROM_H
#ifdef __KERNEL__
-
/*
* Definitions for talking to the Open Firmware PROM on
* Power Macintosh computers.
@@ -17,7 +16,6 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
-
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <asm/atomic.h>
@@ -55,52 +53,18 @@ struct device_node {
unsigned int unique_id;
};
-/* flag descriptions */
-#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
-
-#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
-#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
-
-#define OF_BAD_ADDR ((u64)-1)
-
-static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
-{
- dn->pde = de;
-}
-
-extern struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name);
-#define for_each_node_by_name(dn, name) \
- for (dn = of_find_node_by_name(NULL, name); dn; \
- dn = of_find_node_by_name(dn, name))
-extern struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type);
-#define for_each_node_by_type(dn, type) \
- for (dn = of_find_node_by_type(NULL, type); dn; \
- dn = of_find_node_by_type(dn, type))
-extern struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compat);
-extern struct device_node *of_find_node_by_path(const char *path);
-extern struct device_node *of_find_node_by_phandle(phandle handle);
-extern struct device_node *of_get_parent(const struct device_node *node);
-extern struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev);
-extern struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp);
-extern int of_device_is_compatible(const struct device_node *device,
- const char *);
-extern const void *of_get_property(const struct device_node *node,
- const char *name,
- int *lenp);
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern int of_getintprop_default(struct device_node *np,
const char *name,
int def);
-extern int of_n_addr_cells(struct device_node *np);
-extern int of_n_size_cells(struct device_node *np);
extern void prom_build_devicetree(void);
+/*
+ * NB: This is here while we transition from using asm/prom.h
+ * to linux/openfw.h
+ */
+#include <linux/openfw.h>
+
#endif /* __KERNEL__ */
#endif /* _SPARC_PROM_H */
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 88e62cc..b1557c0 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -2,7 +2,6 @@
#define _SPARC64_PROM_H
#ifdef __KERNEL__
-
/*
* Definitions for talking to the Open Firmware PROM on
* Power Macintosh computers.
@@ -17,7 +16,6 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
-
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <asm/atomic.h>
@@ -63,52 +61,18 @@ struct of_irq_controller {
void *data;
};
-/* flag descriptions */
-#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
-
-#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
-#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
-
-#define OF_BAD_ADDR ((u64)-1)
-
-static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
-{
- dn->pde = de;
-}
-
-extern struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name);
-#define for_each_node_by_name(dn, name) \
- for (dn = of_find_node_by_name(NULL, name); dn; \
- dn = of_find_node_by_name(dn, name))
-extern struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type);
-#define for_each_node_by_type(dn, type) \
- for (dn = of_find_node_by_type(NULL, type); dn; \
- dn = of_find_node_by_type(dn, type))
-extern struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compat);
-extern struct device_node *of_find_node_by_path(const char *path);
-extern struct device_node *of_find_node_by_phandle(phandle handle);
-extern struct device_node *of_get_parent(const struct device_node *node);
-extern struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev);
-extern struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp);
-extern int of_device_is_compatible(const struct device_node *device,
- const char *);
-extern const void *of_get_property(const struct device_node *node,
- const char *name,
- int *lenp);
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern int of_getintprop_default(struct device_node *np,
const char *name,
int def);
-extern int of_n_addr_cells(struct device_node *np);
-extern int of_n_size_cells(struct device_node *np);
extern void prom_build_devicetree(void);
+/*
+ * NB: This is here while we transition from using asm/prom.h
+ * to linux/openfw.h
+ */
+#include <linux/openfw.h>
+
#endif /* __KERNEL__ */
#endif /* _SPARC64_PROM_H */
diff --git a/include/linux/openfw.h b/include/linux/openfw.h
new file mode 100644
index 0000000..d4d9a9c
--- /dev/null
+++ b/include/linux/openfw.h
@@ -0,0 +1,59 @@
+#ifndef _LINUX_OPENFW_H
+#define _LINUX_OPENFW_H
+/*
+ * Definitions for talking to the Open Firmware PROM on
+ * Power Macintosh and other computers.
+ *
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
+ * Updates for SPARC64 by David S. Miller
+ * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/types.h>
+
+#include <asm/bitops.h>
+#include <asm/prom.h>
+
+/* flag descriptions */
+#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
+
+#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
+#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
+
+#define OF_BAD_ADDR ((u64)-1)
+
+extern struct device_node *of_find_node_by_name(struct device_node *from,
+ const char *name);
+#define for_each_node_by_name(dn, name) \
+ for (dn = of_find_node_by_name(NULL, name); dn; \
+ dn = of_find_node_by_name(dn, name))
+extern struct device_node *of_find_node_by_type(struct device_node *from,
+ const char *type);
+#define for_each_node_by_type(dn, type) \
+ for (dn = of_find_node_by_type(NULL, type); dn; \
+ dn = of_find_node_by_type(dn, type))
+extern struct device_node *of_find_compatible_node(struct device_node *from,
+ const char *type, const char *compat);
+extern struct device_node *of_find_node_by_path(const char *path);
+extern struct device_node *of_find_node_by_phandle(phandle handle);
+extern struct device_node *of_get_parent(const struct device_node *node);
+extern struct device_node *of_get_next_child(const struct device_node *node,
+ struct device_node *prev);
+extern struct property *of_find_property(const struct device_node *np,
+ const char *name,
+ int *lenp);
+extern int of_device_is_compatible(const struct device_node *device,
+ const char *);
+extern const void *of_get_property(const struct device_node *node,
+ const char *name,
+ int *lenp);
+extern int of_n_addr_cells(struct device_node *np);
+extern int of_n_size_cells(struct device_node *np);
+
+#endif /* _LINUX_OPENFW_H */
--
1.5.1
^ permalink raw reply related [flat|nested] 109+ messages in thread
* Re: [PATCH,RFC] Split out common parts of prom.h
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
@ 2007-04-12 4:25 ` David Miller
2007-04-12 16:13 ` Kumar Gala
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
2007-04-12 6:58 ` [PATCH,RFC] Split out common parts of prom.h Segher Boessenkool
2 siblings, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-12 4:25 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 12 Apr 2007 14:19:05 +1000
> This applies on top of all the previous patches I sent (including a merge
> of the sparc64 and powerpc for-2.6.22 trees). So if people can't get it
> to apply, at least I would like some comments on the direction. (I told
> Rusty about the circular inclusion below and he didn't throw up, so I
> figure it isn't too bad as a temporary measure.)
>
> I have built allmodconfig (modified slightly) for Powerpc, Sparc64 and
> Sparc. (All of which fail during the module post processing but for
> reasons not related to these patches as far as I can see.)
This is one approach, and I'm not against it.
Another way is to create a linux/openfw.h that does nothing
but include asm/prom.h as step 1. Step 2 is to convert all
the include sites, and step 3 is to move the relevant
prom.h bits into openfw.h
To be honest, since you're the one doing all of the hard work I think
you should be allowed to make the choice on how to go about this :-)
^ permalink raw reply [flat|nested] 109+ messages in thread
* [PATCH] Start split out of common open firmware code
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
2007-04-12 4:25 ` David Miller
@ 2007-04-12 5:34 ` Stephen Rothwell
[not found] ` <20070424223245.78f4fdfb.sfr@canb.auug .org.au>
` (3 more replies)
2007-04-12 6:58 ` [PATCH,RFC] Split out common parts of prom.h Segher Boessenkool
2 siblings, 4 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-12 5:34 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts the
first trivially common bits from the prom.c files into it.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/Kconfig | 3 ++
arch/powerpc/kernel/prom.c | 42 ----------------------------
arch/sparc/Kconfig | 3 ++
arch/sparc/kernel/prom.c | 42 ----------------------------
arch/sparc64/Kconfig | 3 ++
arch/sparc64/kernel/prom.c | 42 ----------------------------
include/asm-powerpc/prom.h | 3 ++
include/asm-sparc/prom.h | 3 ++
include/asm-sparc64/prom.h | 3 ++
kernel/Makefile | 1 +
kernel/openfw.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
11 files changed, 84 insertions(+), 126 deletions(-)
create mode 100644 kernel/openfw.c
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 20a8fdc..00fceed 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -99,6 +99,9 @@ config ARCH_MAY_HAVE_PC_FDC
config PPC_OF
def_bool y
+config OPENFW
+ def_bool y
+
config PPC_UDBG_16550
bool
default n
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ec6921c..2971f1e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1042,36 +1042,6 @@ void __init early_init_devtree(void *params)
#undef printk
-int of_n_addr_cells(struct device_node* np)
-{
- const int *ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node* np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
/**
* Construct and return a list of the device_nodes with a given name.
*/
@@ -1622,18 +1592,6 @@ struct property *of_find_property(const struct device_node *np,
EXPORT_SYMBOL(of_find_property);
/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
-/*
* Add a property to a node
*/
int prom_add_property(struct device_node* np, struct property* prop)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index bd992c0..e8be7a1 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -21,6 +21,9 @@ config GENERIC_ISA_DMA
bool
default y
+config OPENFW
+ def_bool y
+
source "init/Kconfig"
menu "General machine setup"
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index eed140b..ac3f3c2 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -168,18 +168,6 @@ struct property *of_find_property(const struct device_node *np,
}
EXPORT_SYMBOL(of_find_property);
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
@@ -193,36 +181,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);
-int of_n_addr_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 2 */
- return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 590a41b..1b52ab1 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -58,6 +58,9 @@ config AUDIT_ARCH
bool
default y
+config OPENFW
+ def_bool y
+
choice
prompt "Kernel page size"
default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 5e1fcd0..7ef5488 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -172,18 +172,6 @@ struct property *of_find_property(const struct device_node *np,
}
EXPORT_SYMBOL(of_find_property);
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
@@ -197,36 +185,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);
-int of_n_addr_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 2 */
- return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index cc85c7f..4a9a479 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -21,6 +21,9 @@
#include <asm/irq.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 5188852..411018d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -20,6 +20,9 @@
#include <linux/proc_fs.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index b1557c0..1097e66 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -20,6 +20,9 @@
#include <linux/proc_fs.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/kernel/Makefile b/kernel/Makefile
index ac6b27a..7fd57ed 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
obj-$(CONFIG_UTS_NS) += utsname.o
obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
+obj-$(CONFIG_OPENFW) += openfw.o
ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y)
# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
diff --git a/kernel/openfw.c b/kernel/openfw.c
new file mode 100644
index 0000000..04a8cc2
--- /dev/null
+++ b/kernel/openfw.c
@@ -0,0 +1,65 @@
+/*
+ * Procedures for creating, accessing and interpreting the device tree.
+ *
+ * Paul Mackerras August 1996.
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
+ * {engebret|bergner}@us.ibm.com
+ *
+ * Adapted for sparc and sparc64 by David S. Miller davem@davemloft.net
+ *
+ * Reconsolidated from arch/x/kernel/prom.c by Stephen Rothwell.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/module.h>
+#include <linux/openfw.h>
+
+int of_n_addr_cells(struct device_node *np)
+{
+ const int *ip;
+
+ do {
+ if (np->parent)
+ np = np->parent;
+ ip = of_get_property(np, "#address-cells", NULL);
+ if (ip)
+ return *ip;
+ } while (np->parent);
+ /* No #address-cells property for the root node */
+ return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_addr_cells);
+
+int of_n_size_cells(struct device_node *np)
+{
+ const int *ip;
+
+ do {
+ if (np->parent)
+ np = np->parent;
+ ip = of_get_property(np, "#size-cells", NULL);
+ if (ip)
+ return *ip;
+ } while (np->parent);
+ /* No #size-cells property for the root node */
+ return OF_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_size_cells);
+
+/*
+ * Find a property with a given name for a given node
+ * and return the value.
+ */
+const void *of_get_property(const struct device_node *np, const char *name,
+ int *lenp)
+{
+ struct property *pp = of_find_property(np, name, lenp);
+
+ return pp ? pp->value : NULL;
+}
+EXPORT_SYMBOL(of_get_property);
--
1.5.1
^ permalink raw reply related [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
[not found] ` <20070424223245.78f4fdfb.sfr@canb.auug .org.au>
@ 2007-04-12 5:41 ` David Miller
2007-04-12 5:50 ` Benjamin Herrenschmidt
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
3 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-12 5:41 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 12 Apr 2007 15:34:24 +1000
> This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts the
> first trivially common bits from the prom.c files into it.
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
This looks great to me.
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
[not found] ` <20070424223245.78f4fdfb.sfr@canb.auug .org.au>
2007-04-12 5:41 ` David Miller
@ 2007-04-12 5:50 ` Benjamin Herrenschmidt
2007-04-12 6:25 ` David Miller
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
3 siblings, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-12 5:50 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Thu, 2007-04-12 at 15:34 +1000, Stephen Rothwell wrote:
> This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts the
> first trivially common bits from the prom.c files into it.
Is this the right place ?
I want to split flat DT from live DT in separate files, then we have
of_device.c and of_platform.c that will need merging too, and possibly
the filesystem... that's a lot to put in kernel/
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 5:50 ` Benjamin Herrenschmidt
@ 2007-04-12 6:25 ` David Miller
2007-04-12 6:36 ` Benjamin Herrenschmidt
2007-04-12 7:00 ` Segher Boessenkool
0 siblings, 2 replies; 109+ messages in thread
From: David Miller @ 2007-04-12 6:25 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 12 Apr 2007 15:50:20 +1000
> On Thu, 2007-04-12 at 15:34 +1000, Stephen Rothwell wrote:
> > This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts the
> > first trivially common bits from the prom.c files into it.
>
> Is this the right place ?
>
> I want to split flat DT from live DT in separate files, then we have
> of_device.c and of_platform.c that will need merging too, and possibly
> the filesystem... that's a lot to put in kernel/
We could make drivers/openfw/{device,platform}.c, maybe that would
work best?
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 6:25 ` David Miller
@ 2007-04-12 6:36 ` Benjamin Herrenschmidt
2007-04-12 6:40 ` David Miller
2007-04-12 7:00 ` Segher Boessenkool
1 sibling, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-12 6:36 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
On Wed, 2007-04-11 at 23:25 -0700, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Thu, 12 Apr 2007 15:50:20 +1000
>
> > On Thu, 2007-04-12 at 15:34 +1000, Stephen Rothwell wrote:
> > > This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts the
> > > first trivially common bits from the prom.c files into it.
> >
> > Is this the right place ?
> >
> > I want to split flat DT from live DT in separate files, then we have
> > of_device.c and of_platform.c that will need merging too, and possibly
> > the filesystem... that's a lot to put in kernel/
>
> We could make drivers/openfw/{device,platform}.c, maybe that would
> work best?
Yeah, we could have something like:
- base.c (the core stuff that stephen just merged)
- parse.c (the parsers for irq tree, "reg"/"ranges", ...)
- device.c
- platform.c
(there is some work needed for the above to consolidate properly, I
suppose I'm the one who should do it since I'm to blame for most of that
code :-)
- fs.c
In fact, we could even have trampoline.c for the powerpc prom_init
thingy though I'm not sure there is any interest in having that made
common with sparc, so it might as well stay where it is (in fact, we've
been considering moving it to the zImage wrapper and using the flattened
format to pass the DT along).
In addition, there are things that relate to the flat device-tree which
I don't know how much we want to make generic, both walking it, but also
things to generate one, mostly for use by iSeries and zImage wrappers...
Note that for the filesystem, we really want to stick to our binary
representation while you really want to stick to your text rep (we
decided to disagree iirc :-) I think we could keep a lot in common still
and just have a mount option to indicate how the file content is
exposed.
It's not really 2.6.22 material as far as I'm concerned as I'm pretty
busy with other things, unless of course Stephen feel like doing it
all :-) I'll see what I can do for the next cycle though.
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 6:36 ` Benjamin Herrenschmidt
@ 2007-04-12 6:40 ` David Miller
0 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-12 6:40 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 12 Apr 2007 16:36:14 +1000
> Note that for the filesystem, we really want to stick to our binary
> representation while you really want to stick to your text rep (we
> decided to disagree iirc :-) I think we could keep a lot in common still
> and just have a mount option to indicate how the file content is
> exposed.
I'm fine with that.
> It's not really 2.6.22 material as far as I'm concerned as I'm pretty
> busy with other things, unless of course Stephen feel like doing it
> all :-) I'll see what I can do for the next cycle though.
It would be nice to merge as much of the truly common stuff as
soon as possible.
The sooner I don't have to fix the same bug in multiple locations, the
better :)
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH,RFC] Split out common parts of prom.h
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
2007-04-12 4:25 ` David Miller
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
@ 2007-04-12 6:58 ` Segher Boessenkool
2 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-12 6:58 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
> This creates linux/openfw.h and includes asm/prom.h from it.
Nice stuff. Can we please name it openfirmware.h though?
Or of.h if shorter names are preferred. "openfw" is an
abbreviation I've never seen before though :-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 6:25 ` David Miller
2007-04-12 6:36 ` Benjamin Herrenschmidt
@ 2007-04-12 7:00 ` Segher Boessenkool
2007-04-23 7:43 ` Stephen Rothwell
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-12 7:00 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
>>> This creates kernel/openfw.c (depending on CONFIG_OPENFW) and puts
>>> the
>>> first trivially common bits from the prom.c files into it.
>>
>> Is this the right place ?
>>
>> I want to split flat DT from live DT in separate files, then we have
>> of_device.c and of_platform.c that will need merging too, and possibly
>> the filesystem... that's a lot to put in kernel/
>
> We could make drivers/openfw/{device,platform}.c, maybe that would
> work best?
drivers/ is the wrong place to put this IMHO. Why not
use kernel/openfirmware/*.[ch] ?
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH,RFC] Split out common parts of prom.h
2007-04-12 4:25 ` David Miller
@ 2007-04-12 16:13 ` Kumar Gala
2007-04-12 19:19 ` Segher Boessenkool
0 siblings, 1 reply; 109+ messages in thread
From: Kumar Gala @ 2007-04-12 16:13 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
On Apr 11, 2007, at 11:25 PM, David Miller wrote:
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 12 Apr 2007 14:19:05 +1000
>
>> This applies on top of all the previous patches I sent (including
>> a merge
>> of the sparc64 and powerpc for-2.6.22 trees). So if people can't
>> get it
>> to apply, at least I would like some comments on the direction. (I
>> told
>> Rusty about the circular inclusion below and he didn't throw up, so I
>> figure it isn't too bad as a temporary measure.)
>>
>> I have built allmodconfig (modified slightly) for Powerpc, Sparc64
>> and
>> Sparc. (All of which fail during the module post processing but for
>> reasons not related to these patches as far as I can see.)
>
> This is one approach, and I'm not against it.
>
> Another way is to create a linux/openfw.h that does nothing
> but include asm/prom.h as step 1. Step 2 is to convert all
> the include sites, and step 3 is to move the relevant
> prom.h bits into openfw.h
>
> To be honest, since you're the one doing all of the hard work I think
> you should be allowed to make the choice on how to go about this :-)
Should we drop prom.h all together. I haven't looked but I would
think OLPC would need (or use) some of this as well since its using OF.
- k
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH,RFC] Split out common parts of prom.h
2007-04-12 16:13 ` Kumar Gala
@ 2007-04-12 19:19 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-12 19:19 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, paulus, David Miller, sfr
> Should we drop prom.h all together.
That presumably is the final goal. It'll take a
while to get there, though, and in the meantime
prom.h is there for backward compatibility.
> I haven't looked but I would
> think OLPC would need (or use) some of this as well since its using OF.
The OLPC kernel currently doesn't use OF; it guesses
a lot instead, just like on any other x86 machine.
This can change though, but it's not a priority for
the OLPC project right now (since things "work" anyway).
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] [SPARC/64] Make device_node name and type const
2007-04-03 13:24 ` [PATCH] [SPARC/64] Make device_node name and type const Stephen Rothwell
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
@ 2007-04-12 21:41 ` David Miller
1 sibling, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-12 21:41 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 3 Apr 2007 23:24:06 +1000
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Applied, thanks Stephen.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] [SPARC/64] Remove get_property
2007-04-03 13:05 ` [PATCH] [SPARC/64] " Stephen Rothwell
2007-04-03 13:24 ` [PATCH] [SPARC/64] Make device_node name and type const Stephen Rothwell
@ 2007-04-12 21:42 ` David Miller
1 sibling, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-12 21:42 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 3 Apr 2007 23:05:05 +1000
> All the usages have been renamed to of_get_property.
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
...
> If you take the curent powerpc tree (commit
> 1b56c1da9eec35c610fa2168d754ce567615a6ee) and apply all the patches I
> sent today (1-6 then 1-17) then merge that with your current for-2.6.22
> tree (commit ab571e3091f055b0f8648822e11ee6413993f899), then you can
> apply this. :-)
>
> I did a test sparc64 allmodconfig build (and it get as far as can be
> expected :-))
Yikes, this is getting messy :-)
We will have some staging issues during the 2.6.22 merge window.
For now why don't I leave this one out of my tree and you can
just put it into the powerpc tree which eliminated all of
the instances of get_property()?
Thanks.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-12 7:00 ` Segher Boessenkool
@ 2007-04-23 7:43 ` Stephen Rothwell
2007-04-23 18:30 ` Segher Boessenkool
0 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-23 7:43 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: paulus, David Miller, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
On Thu, 12 Apr 2007 09:00:45 +0200 Segher Boessenkool <segher@kernel.crashing.org> wrote:
>
> drivers/ is the wrong place to put this IMHO. Why not
> use kernel/openfirmware/*.[ch] ?
We have drivers/acpi as a precedent ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH] Start split out of common open firmware code
2007-04-23 7:43 ` Stephen Rothwell
@ 2007-04-23 18:30 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-23 18:30 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: paulus, David Miller, linuxppc-dev
>> drivers/ is the wrong place to put this IMHO. Why not
>> use kernel/openfirmware/*.[ch] ?
>
> We have drivers/acpi as a precedent ...
That doesn't mean it's a good place for firmware interface
code, it just means that the ACPI code currently lives
there :-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* [PATCH 1/6] Start split out of common open firmware code
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
` (2 preceding siblings ...)
2007-04-12 5:50 ` Benjamin Herrenschmidt
@ 2007-04-24 12:32 ` Stephen Rothwell
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
` (6 more replies)
3 siblings, 7 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:32 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This creates drivers/openfw/base.c (depending on CONFIG_OPENFW) and puts
the first trivially common bits from the prom.c files into it.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/Kconfig | 3 ++
arch/powerpc/kernel/prom.c | 42 ----------------------------
arch/sparc/Kconfig | 3 ++
arch/sparc/kernel/prom.c | 42 ----------------------------
arch/sparc64/Kconfig | 3 ++
arch/sparc64/kernel/prom.c | 42 ----------------------------
drivers/Makefile | 1 +
drivers/openfw/Makefile | 1 +
drivers/openfw/base.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
include/asm-powerpc/prom.h | 3 ++
include/asm-sparc/prom.h | 3 ++
include/asm-sparc64/prom.h | 3 ++
12 files changed, 85 insertions(+), 126 deletions(-)
create mode 100644 drivers/openfw/Makefile
create mode 100644 drivers/openfw/base.c
The only difference with this one is to use drivers/openfw/
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 740892a..dea4892 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -99,6 +99,9 @@ config ARCH_MAY_HAVE_PC_FDC
config PPC_OF
def_bool y
+config OPENFW
+ def_bool y
+
config PPC_UDBG_16550
bool
default n
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index caef555..d701e89 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1042,36 +1042,6 @@ void __init early_init_devtree(void *params)
#undef printk
-int of_n_addr_cells(struct device_node* np)
-{
- const int *ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node* np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
/** Checks if the given "compat" string matches one of the strings in
* the device's "compatible" property
*/
@@ -1529,18 +1499,6 @@ struct property *of_find_property(const struct device_node *np,
EXPORT_SYMBOL(of_find_property);
/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
-/*
* Add a property to a node
*/
int prom_add_property(struct device_node* np, struct property* prop)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index bd992c0..e8be7a1 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -21,6 +21,9 @@ config GENERIC_ISA_DMA
bool
default y
+config OPENFW
+ def_bool y
+
source "init/Kconfig"
menu "General machine setup"
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index eed140b..ac3f3c2 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -168,18 +168,6 @@ struct property *of_find_property(const struct device_node *np,
}
EXPORT_SYMBOL(of_find_property);
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
@@ -193,36 +181,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);
-int of_n_addr_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 2 */
- return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 590a41b..1b52ab1 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -58,6 +58,9 @@ config AUDIT_ARCH
bool
default y
+config OPENFW
+ def_bool y
+
choice
prompt "Kernel page size"
default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 5e1fcd0..7ef5488 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -172,18 +172,6 @@ struct property *of_find_property(const struct device_node *np,
}
EXPORT_SYMBOL(of_find_property);
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
- int *lenp)
-{
- struct property *pp = of_find_property(np,name,lenp);
- return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
@@ -197,36 +185,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);
-int of_n_addr_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#address-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #address-cells property for the root node, default to 2 */
- return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
- const int* ip;
- do {
- if (np->parent)
- np = np->parent;
- ip = of_get_property(np, "#size-cells", NULL);
- if (ip != NULL)
- return *ip;
- } while (np->parent);
- /* No #size-cells property for the root node, default to 1 */
- return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
diff --git a/drivers/Makefile b/drivers/Makefile
index 3a718f5..ffaf094 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -81,3 +81,4 @@ obj-$(CONFIG_GENERIC_TIME) += clocksource/
obj-$(CONFIG_DMA_ENGINE) += dma/
obj-$(CONFIG_HID) += hid/
obj-$(CONFIG_PPC_PS3) += ps3/
+obj-$(CONFIG_OPENFW) += openfw/
diff --git a/drivers/openfw/Makefile b/drivers/openfw/Makefile
new file mode 100644
index 0000000..cddbe84
--- /dev/null
+++ b/drivers/openfw/Makefile
@@ -0,0 +1 @@
+obj-y = base.o
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
new file mode 100644
index 0000000..04a8cc2
--- /dev/null
+++ b/drivers/openfw/base.c
@@ -0,0 +1,65 @@
+/*
+ * Procedures for creating, accessing and interpreting the device tree.
+ *
+ * Paul Mackerras August 1996.
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
+ * {engebret|bergner}@us.ibm.com
+ *
+ * Adapted for sparc and sparc64 by David S. Miller davem@davemloft.net
+ *
+ * Reconsolidated from arch/x/kernel/prom.c by Stephen Rothwell.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/module.h>
+#include <linux/openfw.h>
+
+int of_n_addr_cells(struct device_node *np)
+{
+ const int *ip;
+
+ do {
+ if (np->parent)
+ np = np->parent;
+ ip = of_get_property(np, "#address-cells", NULL);
+ if (ip)
+ return *ip;
+ } while (np->parent);
+ /* No #address-cells property for the root node */
+ return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_addr_cells);
+
+int of_n_size_cells(struct device_node *np)
+{
+ const int *ip;
+
+ do {
+ if (np->parent)
+ np = np->parent;
+ ip = of_get_property(np, "#size-cells", NULL);
+ if (ip)
+ return *ip;
+ } while (np->parent);
+ /* No #size-cells property for the root node */
+ return OF_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_size_cells);
+
+/*
+ * Find a property with a given name for a given node
+ * and return the value.
+ */
+const void *of_get_property(const struct device_node *np, const char *name,
+ int *lenp)
+{
+ struct property *pp = of_find_property(np, name, lenp);
+
+ return pp ? pp->value : NULL;
+}
+EXPORT_SYMBOL(of_get_property);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 5a36186..30cea54 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -21,6 +21,9 @@
#include <asm/irq.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 5188852..411018d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -20,6 +20,9 @@
#include <linux/proc_fs.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index b1557c0..1097e66 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -20,6 +20,9 @@
#include <linux/proc_fs.h>
#include <asm/atomic.h>
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
typedef u32 phandle;
typedef u32 ihandle;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 2/6] Consolidate of_device_is_compatible
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
@ 2007-04-24 12:38 ` Stephen Rothwell
2007-04-24 13:36 ` Segher Boessenkool
2007-04-24 23:59 ` Benjamin Herrenschmidt
2007-04-24 12:39 ` [PATCH 3/6] Consolidate of_find_property Stephen Rothwell
` (5 subsequent siblings)
6 siblings, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:38 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
The only difference here is that Sparc uses strncmp to match compatibility
names while PowerPC uses strncasecmp.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 25 -------------------------
arch/sparc/kernel/prom.c | 21 ---------------------
arch/sparc64/kernel/prom.c | 21 ---------------------
drivers/openfw/base.c | 24 ++++++++++++++++++++++++
include/asm-powerpc/prom.h | 2 ++
include/asm-sparc/prom.h | 2 ++
include/asm-sparc64/prom.h | 2 ++
7 files changed, 30 insertions(+), 67 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d701e89..723df55 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1042,31 +1042,6 @@ void __init early_init_devtree(void *params)
#undef printk
-/** Checks if the given "compat" string matches one of the strings in
- * the device's "compatible" property
- */
-int of_device_is_compatible(const struct device_node *device,
- const char *compat)
-{
- const char* cp;
- int cplen, l;
-
- cp = of_get_property(device, "compatible", &cplen);
- if (cp == NULL)
- return 0;
- while (cplen > 0) {
- if (strncasecmp(cp, compat, strlen(compat)) == 0)
- return 1;
- l = strlen(cp) + 1;
- cp += l;
- cplen -= l;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
-
/**
* Indicates whether the root node has a given value in its
* compatible property.
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index ac3f3c2..f2ce0d4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -32,27 +32,6 @@ static struct device_node *allnodes;
*/
static DEFINE_RWLOCK(devtree_lock);
-int of_device_is_compatible(const struct device_node *device,
- const char *compat)
-{
- const char* cp;
- int cplen, l;
-
- cp = of_get_property(device, "compatible", &cplen);
- if (cp == NULL)
- return 0;
- while (cplen > 0) {
- if (strncmp(cp, compat, strlen(compat)) == 0)
- return 1;
- l = strlen(cp) + 1;
- cp += l;
- cplen -= l;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
struct device_node *of_get_parent(const struct device_node *node)
{
struct device_node *np;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 7ef5488..d6dd972 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -36,27 +36,6 @@ static struct device_node *allnodes;
*/
static DEFINE_RWLOCK(devtree_lock);
-int of_device_is_compatible(const struct device_node *device,
- const char *compat)
-{
- const char* cp;
- int cplen, l;
-
- cp = of_get_property(device, "compatible", &cplen);
- if (cp == NULL)
- return 0;
- while (cplen > 0) {
- if (strncmp(cp, compat, strlen(compat)) == 0)
- return 1;
- l = strlen(cp) + 1;
- cp += l;
- cplen -= l;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
struct device_node *of_get_parent(const struct device_node *node)
{
struct device_node *np;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 04a8cc2..0751313 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -63,3 +63,27 @@ const void *of_get_property(const struct device_node *np, const char *name,
return pp ? pp->value : NULL;
}
EXPORT_SYMBOL(of_get_property);
+
+/** Checks if the given "compat" string matches one of the strings in
+ * the device's "compatible" property
+ */
+int of_device_is_compatible(const struct device_node *device,
+ const char *compat)
+{
+ const char* cp;
+ int cplen, l;
+
+ cp = of_get_property(device, "compatible", &cplen);
+ if (cp == NULL)
+ return 0;
+ while (cplen > 0) {
+ if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
+ return 1;
+ l = strlen(cp) + 1;
+ cp += l;
+ cplen -= l;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(of_device_is_compatible);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 30cea54..1f3e8cd 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -24,6 +24,8 @@
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
+
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 411018d..cc049fd 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -23,6 +23,8 @@
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
+
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 1097e66..843f9e8 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -23,6 +23,8 @@
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
+
typedef u32 phandle;
typedef u32 ihandle;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 3/6] Consolidate of_find_property
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
@ 2007-04-24 12:39 ` Stephen Rothwell
2007-04-24 13:41 ` Segher Boessenkool
2007-04-25 0:00 ` Benjamin Herrenschmidt
2007-04-24 12:40 ` [PATCH 4/6] Consolidate of_get_parent Stephen Rothwell
` (4 subsequent siblings)
6 siblings, 2 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:39 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
The only change here is that a readlock is taken while the property list
is being traversed on Sparc where it was not taken previously.
Also, Sparc uses strcasecmp to compare property names while PowerPC
uses strcmp.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 24 +-----------------------
arch/sparc/kernel/prom.c | 22 +---------------------
arch/sparc64/kernel/prom.c | 22 +---------------------
drivers/openfw/base.c | 26 ++++++++++++++++++++++++++
include/asm-powerpc/prom.h | 1 +
include/asm-sparc/prom.h | 1 +
include/asm-sparc64/prom.h | 1 +
7 files changed, 32 insertions(+), 65 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 723df55..939d5e4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -79,10 +79,7 @@ struct boot_param_header *initial_boot_params;
static struct device_node *allnodes = NULL;
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock; /* temporary while merging */
/* export that to outside world */
struct device_node *of_chosen;
@@ -1454,25 +1451,6 @@ static int __init prom_reconfig_setup(void)
__initcall(prom_reconfig_setup);
#endif
-struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp)
-{
- struct property *pp;
-
- read_lock(&devtree_lock);
- for (pp = np->properties; pp != 0; pp = pp->next)
- if (strcmp(pp->name, name) == 0) {
- if (lenp != 0)
- *lenp = pp->length;
- break;
- }
- read_unlock(&devtree_lock);
-
- return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
/*
* Add a property to a node
*/
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index f2ce0d4..0f5aab4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -27,10 +27,7 @@
static struct device_node *allnodes;
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock; /* temporary while merging */
struct device_node *of_get_parent(const struct device_node *node)
{
@@ -130,23 +127,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
}
EXPORT_SYMBOL(of_find_compatible_node);
-struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp)
-{
- struct property *pp;
-
- for (pp = np->properties; pp != 0; pp = pp->next) {
- if (strcasecmp(pp->name, name) == 0) {
- if (lenp != 0)
- *lenp = pp->length;
- break;
- }
- }
- return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index d6dd972..c759660 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -31,10 +31,7 @@
static struct device_node *allnodes;
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock; /* temporary while merging */
struct device_node *of_get_parent(const struct device_node *node)
{
@@ -134,23 +131,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
}
EXPORT_SYMBOL(of_find_compatible_node);
-struct property *of_find_property(const struct device_node *np,
- const char *name,
- int *lenp)
-{
- struct property *pp;
-
- for (pp = np->properties; pp != 0; pp = pp->next) {
- if (strcasecmp(pp->name, name) == 0) {
- if (lenp != 0)
- *lenp = pp->length;
- break;
- }
- }
- return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 0751313..2597d29 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -18,6 +18,12 @@
*/
#include <linux/module.h>
#include <linux/openfw.h>
+#include <linux/spinlock.h>
+
+/* use when traversing tree through the allnext, child, sibling,
+ * or parent members of struct device_node.
+ */
+DEFINE_RWLOCK(devtree_lock);
int of_n_addr_cells(struct device_node *np)
{
@@ -51,6 +57,26 @@ int of_n_size_cells(struct device_node *np)
}
EXPORT_SYMBOL(of_n_size_cells);
+struct property *of_find_property(const struct device_node *np,
+ const char *name,
+ int *lenp)
+{
+ struct property *pp;
+
+ read_lock(&devtree_lock);
+ for (pp = np->properties; pp != 0; pp = pp->next) {
+ if (of_prop_cmp(pp->name, name) == 0) {
+ if (lenp != 0)
+ *lenp = pp->length;
+ break;
+ }
+ }
+ read_unlock(&devtree_lock);
+
+ return pp;
+}
+EXPORT_SYMBOL(of_find_property);
+
/*
* Find a property with a given name for a given node
* and return the value.
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 1f3e8cd..a0679be 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -25,6 +25,7 @@
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index cc049fd..d3dc05b 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -24,6 +24,7 @@
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 843f9e8..a1b64e7 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -24,6 +24,7 @@
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
typedef u32 phandle;
typedef u32 ihandle;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 4/6] Consolidate of_get_parent
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
2007-04-24 12:39 ` [PATCH 3/6] Consolidate of_find_property Stephen Rothwell
@ 2007-04-24 12:40 ` Stephen Rothwell
2007-04-24 14:42 ` Loeliger Jon-LOELIGER
2007-04-24 12:42 ` [PATCH 5/6] Consolidate of_get_next_child Stephen Rothwell
` (3 subsequent siblings)
6 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:40 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This requires creating dummy of_node_{get,put} routines for sparc and
sparc64. It also adds a readlocal around the parent accesses.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 21 ---------------------
arch/sparc/kernel/prom.c | 13 -------------
arch/sparc64/kernel/prom.c | 13 -------------
drivers/openfw/base.c | 21 +++++++++++++++++++++
include/asm-sparc/prom.h | 9 +++++++++
include/asm-sparc64/prom.h | 9 +++++++++
6 files changed, 39 insertions(+), 47 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 939d5e4..55e67ca 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1225,27 +1225,6 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
EXPORT_SYMBOL(of_find_all_nodes);
/**
- * of_get_parent - Get a node's parent if any
- * @node: Node to get parent
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_get_parent(const struct device_node *node)
-{
- struct device_node *np;
-
- if (!node)
- return NULL;
-
- read_lock(&devtree_lock);
- np = of_node_get(node->parent);
- read_unlock(&devtree_lock);
- return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
-/**
* of_get_next_child - Iterate a node childs
* @node: parent node
* @prev: previous child of the parent node, or NULL to get first
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 0f5aab4..b378715 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -29,19 +29,6 @@ static struct device_node *allnodes;
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_get_parent(const struct device_node *node)
-{
- struct device_node *np;
-
- if (!node)
- return NULL;
-
- np = node->parent;
-
- return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev)
{
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index c759660..f876079 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -33,19 +33,6 @@ static struct device_node *allnodes;
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_get_parent(const struct device_node *node)
-{
- struct device_node *np;
-
- if (!node)
- return NULL;
-
- np = node->parent;
-
- return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev)
{
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 2597d29..3fc02de 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -113,3 +113,24 @@ int of_device_is_compatible(const struct device_node *device,
return 0;
}
EXPORT_SYMBOL(of_device_is_compatible);
+
+/**
+ * of_get_parent - Get a node's parent if any
+ * @node: Node to get parent
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_get_parent(const struct device_node *node)
+{
+ struct device_node *np;
+
+ if (!node)
+ return NULL;
+
+ read_lock(&devtree_lock);
+ np = of_node_get(node->parent);
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_get_parent);
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index d3dc05b..4621af6 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -66,6 +66,15 @@ extern int of_getintprop_default(struct device_node *np,
extern void prom_build_devicetree(void);
+/* Dummy ref counting routines - to be implemented later */
+static inline struct device_node *of_node_get(struct device_node *node)
+{
+ return node;
+}
+static inline void of_node_put(struct device_node *node)
+{
+}
+
/*
* NB: This is here while we transition from using asm/prom.h
* to linux/openfw.h
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index a1b64e7..c36b884 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -74,6 +74,15 @@ extern int of_getintprop_default(struct device_node *np,
extern void prom_build_devicetree(void);
+/* Dummy ref counting routines - to be implemented later */
+static inline struct device_node *of_node_get(struct device_node *node)
+{
+ return node;
+}
+static inline void of_node_put(struct device_node *node)
+{
+}
+
/*
* NB: This is here while we transition from using asm/prom.h
* to linux/openfw.h
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 5/6] Consolidate of_get_next_child
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
` (2 preceding siblings ...)
2007-04-24 12:40 ` [PATCH 4/6] Consolidate of_get_parent Stephen Rothwell
@ 2007-04-24 12:42 ` Stephen Rothwell
2007-04-24 12:43 ` [PATCH 6/6] Consolidate of_find_node_by routines Stephen Rothwell
` (2 subsequent siblings)
6 siblings, 0 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:42 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This adds a readlock around the child/next accesses on Sparc.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 24 ------------------------
arch/sparc/kernel/prom.c | 14 --------------
arch/sparc64/kernel/prom.c | 14 --------------
drivers/openfw/base.c | 24 ++++++++++++++++++++++++
4 files changed, 24 insertions(+), 52 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 55e67ca..90901e4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1225,30 +1225,6 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
EXPORT_SYMBOL(of_find_all_nodes);
/**
- * of_get_next_child - Iterate a node childs
- * @node: parent node
- * @prev: previous child of the parent node, or NULL to get first
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev)
-{
- struct device_node *next;
-
- read_lock(&devtree_lock);
- next = prev ? prev->sibling : node->child;
- for (; next != 0; next = next->sibling)
- if (of_node_get(next))
- break;
- of_node_put(prev);
- read_unlock(&devtree_lock);
- return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
-/**
* of_node_get - Increment refcount of a node
* @node: Node to inc refcount, NULL is supported to
* simplify writing of callers
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index b378715..3f8ccfa 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -29,20 +29,6 @@ static struct device_node *allnodes;
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev)
-{
- struct device_node *next;
-
- next = prev ? prev->sibling : node->child;
- for (; next != 0; next = next->sibling) {
- break;
- }
-
- return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = allnodes;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index f876079..be3b958 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -33,20 +33,6 @@ static struct device_node *allnodes;
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_get_next_child(const struct device_node *node,
- struct device_node *prev)
-{
- struct device_node *next;
-
- next = prev ? prev->sibling : node->child;
- for (; next != 0; next = next->sibling) {
- break;
- }
-
- return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = allnodes;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 3fc02de..60f7bd4 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -134,3 +134,27 @@ struct device_node *of_get_parent(const struct device_node *node)
return np;
}
EXPORT_SYMBOL(of_get_parent);
+
+/**
+ * of_get_next_child - Iterate a node childs
+ * @node: parent node
+ * @prev: previous child of the parent node, or NULL to get first
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_get_next_child(const struct device_node *node,
+ struct device_node *prev)
+{
+ struct device_node *next;
+
+ read_lock(&devtree_lock);
+ next = prev ? prev->sibling : node->child;
+ for (; next; next = next->sibling)
+ if (of_node_get(next))
+ break;
+ of_node_put(prev);
+ read_unlock(&devtree_lock);
+ return next;
+}
+EXPORT_SYMBOL(of_get_next_child);
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH 6/6] Consolidate of_find_node_by routines
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
` (3 preceding siblings ...)
2007-04-24 12:42 ` [PATCH 5/6] Consolidate of_get_next_child Stephen Rothwell
@ 2007-04-24 12:43 ` Stephen Rothwell
2007-04-25 0:01 ` Benjamin Herrenschmidt
2007-04-24 13:27 ` [PATCH 1/6] Start split out of common open firmware code Segher Boessenkool
2007-04-24 23:35 ` David Miller
6 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-24 12:43 UTC (permalink / raw)
To: David S. Miller, paulus; +Cc: ppc-dev
This consolidates the routines of_find_node_by_path, of_find_node_by_name,
of_find_node_by_type and of_find_compatible_device. Again, the comparison
of strings are done differently by Sparc and PowerPC and also these add
readlocks around the iterations.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/prom.c | 113 +-------------------------------------------
arch/sparc/kernel/prom.c | 61 +-----------------------
arch/sparc64/kernel/prom.c | 61 +-----------------------
drivers/openfw/base.c | 114 ++++++++++++++++++++++++++++++++++++++++++++
include/asm-powerpc/prom.h | 1 +
include/asm-sparc/prom.h | 1 +
include/asm-sparc64/prom.h | 1 +
7 files changed, 120 insertions(+), 232 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 90901e4..fc64bcb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -77,7 +77,7 @@ static struct boot_param_header *initial_boot_params __initdata;
struct boot_param_header *initial_boot_params;
#endif
-static struct device_node *allnodes = NULL;
+extern struct device_node *allnodes; /* temporary while merging */
extern rwlock_t devtree_lock; /* temporary while merging */
@@ -1068,117 +1068,6 @@ EXPORT_SYMBOL(machine_is_compatible);
*
*******/
-/**
- * of_find_node_by_name - Find a node by its "name" property
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @name: The name string to match against
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name)
-{
- struct device_node *np;
-
- read_lock(&devtree_lock);
- np = from ? from->allnext : allnodes;
- for (; np != NULL; np = np->allnext)
- if (np->name != NULL && strcasecmp(np->name, name) == 0
- && of_node_get(np))
- break;
- of_node_put(from);
- read_unlock(&devtree_lock);
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-/**
- * of_find_node_by_type - Find a node by its "device_type" property
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @name: The type string to match against
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type)
-{
- struct device_node *np;
-
- read_lock(&devtree_lock);
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext)
- if (np->type != 0 && strcasecmp(np->type, type) == 0
- && of_node_get(np))
- break;
- of_node_put(from);
- read_unlock(&devtree_lock);
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-/**
- * of_find_compatible_node - Find a node based on type and one of the
- * tokens in its "compatible" property
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @type: The type string to match "device_type" or NULL to ignore
- * @compatible: The string to match to one of the tokens in the device
- * "compatible" list.
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compatible)
-{
- struct device_node *np;
-
- read_lock(&devtree_lock);
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext) {
- if (type != NULL
- && !(np->type != 0 && strcasecmp(np->type, type) == 0))
- continue;
- if (of_device_is_compatible(np, compatible) && of_node_get(np))
- break;
- }
- of_node_put(from);
- read_unlock(&devtree_lock);
- return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
-/**
- * of_find_node_by_path - Find a node matching a full OF path
- * @path: The full path to match
- *
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_path(const char *path)
-{
- struct device_node *np = allnodes;
-
- read_lock(&devtree_lock);
- for (; np != 0; np = np->allnext) {
- if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
- && of_node_get(np))
- break;
- }
- read_unlock(&devtree_lock);
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
/**
* of_find_node_by_phandle - Find a node given a phandle
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 3f8ccfa..012f983 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -25,23 +25,10 @@
#include <asm/prom.h>
#include <asm/oplib.h>
-static struct device_node *allnodes;
+extern struct device_node *allnodes; /* temporary while merging */
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_find_node_by_path(const char *path)
-{
- struct device_node *np = allnodes;
-
- for (; np != 0; np = np->allnext) {
- if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
- break;
- }
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
-
struct device_node *of_find_node_by_phandle(phandle handle)
{
struct device_node *np;
@@ -54,52 +41,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
}
EXPORT_SYMBOL(of_find_node_by_phandle);
-struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != NULL; np = np->allnext)
- if (np->name != NULL && strcmp(np->name, name) == 0)
- break;
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext)
- if (np->type != 0 && strcmp(np->type, type) == 0)
- break;
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compatible)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext) {
- if (type != NULL
- && !(np->type != 0 && strcmp(np->type, type) == 0))
- continue;
- if (of_device_is_compatible(np, compatible))
- break;
- }
-
- return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index be3b958..ae2065c 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -29,23 +29,10 @@
#include <asm/asi.h>
#include <asm/upa.h>
-static struct device_node *allnodes;
+extern struct device_node *allnodes; /* temporary while merging */
extern rwlock_t devtree_lock; /* temporary while merging */
-struct device_node *of_find_node_by_path(const char *path)
-{
- struct device_node *np = allnodes;
-
- for (; np != 0; np = np->allnext) {
- if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
- break;
- }
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
-
struct device_node *of_find_node_by_phandle(phandle handle)
{
struct device_node *np;
@@ -58,52 +45,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
}
EXPORT_SYMBOL(of_find_node_by_phandle);
-struct device_node *of_find_node_by_name(struct device_node *from,
- const char *name)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != NULL; np = np->allnext)
- if (np->name != NULL && strcmp(np->name, name) == 0)
- break;
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-struct device_node *of_find_node_by_type(struct device_node *from,
- const char *type)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext)
- if (np->type != 0 && strcmp(np->type, type) == 0)
- break;
-
- return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-struct device_node *of_find_compatible_node(struct device_node *from,
- const char *type, const char *compatible)
-{
- struct device_node *np;
-
- np = from ? from->allnext : allnodes;
- for (; np != 0; np = np->allnext) {
- if (type != NULL
- && !(np->type != 0 && strcmp(np->type, type) == 0))
- continue;
- if (of_device_is_compatible(np, compatible))
- break;
- }
-
- return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
int of_getintprop_default(struct device_node *np, const char *name, int def)
{
struct property *prop;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 60f7bd4..bb66e48 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -20,6 +20,8 @@
#include <linux/openfw.h>
#include <linux/spinlock.h>
+struct device_node *allnodes;
+
/* use when traversing tree through the allnext, child, sibling,
* or parent members of struct device_node.
*/
@@ -158,3 +160,115 @@ struct device_node *of_get_next_child(const struct device_node *node,
return next;
}
EXPORT_SYMBOL(of_get_next_child);
+
+/**
+ * of_find_node_by_path - Find a node matching a full OF path
+ * @path: The full path to match
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_path(const char *path)
+{
+ struct device_node *np = allnodes;
+
+ read_lock(&devtree_lock);
+ for (; np; np = np->allnext) {
+ if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
+ && of_node_get(np))
+ break;
+ }
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_find_node_by_path);
+
+/**
+ * of_find_node_by_name - Find a node by its "name" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @name: The name string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_name(struct device_node *from,
+ const char *name)
+{
+ struct device_node *np;
+
+ read_lock(&devtree_lock);
+ np = from ? from->allnext : allnodes;
+ for (; np; np = np->allnext)
+ if (np->name && (of_node_cmp(np->name, name) == 0)
+ && of_node_get(np))
+ break;
+ of_node_put(from);
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_find_node_by_name);
+
+/**
+ * of_find_node_by_type - Find a node by its "device_type" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @name: The type string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_type(struct device_node *from,
+ const char *type)
+{
+ struct device_node *np;
+
+ read_lock(&devtree_lock);
+ np = from ? from->allnext : allnodes;
+ for (; np; np = np->allnext)
+ if (np->type && (of_node_cmp(np->type, type) == 0)
+ && of_node_get(np))
+ break;
+ of_node_put(from);
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_find_node_by_type);
+
+/**
+ * of_find_compatible_node - Find a node based on type and one of the
+ * tokens in its "compatible" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @type: The type string to match "device_type" or NULL to ignore
+ * @compatible: The string to match to one of the tokens in the device
+ * "compatible" list.
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_compatible_node(struct device_node *from,
+ const char *type, const char *compatible)
+{
+ struct device_node *np;
+
+ read_lock(&devtree_lock);
+ np = from ? from->allnext : allnodes;
+ for (; np; np = np->allnext) {
+ if (type
+ && !(np->type && (of_node_cmp(np->type, type) == 0)))
+ continue;
+ if (of_device_is_compatible(np, compatible) && of_node_get(np))
+ break;
+ }
+ of_node_put(from);
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_find_compatible_node);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index a0679be..d0ff917 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -26,6 +26,7 @@
#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
+#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 4621af6..92919ac 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -25,6 +25,7 @@
#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
+#define of_node_cmp(s1, s2) strcmp((s1), (s2))
typedef u32 phandle;
typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index c36b884..d2123c2 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -25,6 +25,7 @@
#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
+#define of_node_cmp(s1, s2) strcmp((s1), (s2))
typedef u32 phandle;
typedef u32 ihandle;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
` (4 preceding siblings ...)
2007-04-24 12:43 ` [PATCH 6/6] Consolidate of_find_node_by routines Stephen Rothwell
@ 2007-04-24 13:27 ` Segher Boessenkool
2007-04-24 14:47 ` Loeliger Jon-LOELIGER
2007-04-25 0:03 ` Benjamin Herrenschmidt
2007-04-24 23:35 ` David Miller
6 siblings, 2 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-24 13:27 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
> +int of_n_addr_cells(struct device_node *np)
> +{
> + const int *ip;
> +
> + do {
> + if (np->parent)
> + np = np->parent;
> + ip = of_get_property(np, "#address-cells", NULL);
> + if (ip)
> + return *ip;
> + } while (np->parent);
> + /* No #address-cells property for the root node */
> + return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
> +}
> +EXPORT_SYMBOL(of_n_addr_cells);
While I realise your patch is just moving stuff around,
can this be fixed please? A missing "#address-cells"
property means "two cells", not "inherit from parent".
The few platforms with a broken tree should just be
fixed (patch the tree in the bootwrapper, or perhaps
_do_ use this workaround, but only on the affected
platforms).
> +int of_n_size_cells(struct device_node *np)
Same here (the default is one cell though).
> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -21,6 +21,9 @@
> #include <asm/irq.h>
> #include <asm/atomic.h>
>
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
> +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
Even worse!
> --- a/include/asm-sparc/prom.h
> +++ b/include/asm-sparc/prom.h
> @@ -20,6 +20,9 @@
> #include <linux/proc_fs.h>
> #include <asm/atomic.h>
>
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
> +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
Those are the defaults for all nodes, not just the
root node.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 2/6] Consolidate of_device_is_compatible
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
@ 2007-04-24 13:36 ` Segher Boessenkool
2007-04-24 23:59 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-24 13:36 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
> The only difference here is that Sparc uses strncmp to match
> compatibility
> names while PowerPC uses strncasecmp.
The sparc behaviour is correct here (not that the powerpc
behaviour hurts much, but...)
Perhaps add a note about this?
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-24 12:39 ` [PATCH 3/6] Consolidate of_find_property Stephen Rothwell
@ 2007-04-24 13:41 ` Segher Boessenkool
2007-04-25 1:43 ` Paul Mackerras
2007-04-25 0:00 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-24 13:41 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
> Also, Sparc uses strcasecmp to compare property names while PowerPC
> uses strcmp.
Property names aren't supposed to contain uppercase
characters. I can swing both ways on which of strcmp()
or strcasecmp() is better, but there seems no reason
to do this differently on each platform.
Let me repeat this isn't an argument against your
patch -- indeed, it is probably better to keep the
status quo as the first merging step; I'm just
pointing out stuff that should be fixed in some
follow up.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* RE: [PATCH 4/6] Consolidate of_get_parent
2007-04-24 12:40 ` [PATCH 4/6] Consolidate of_get_parent Stephen Rothwell
@ 2007-04-24 14:42 ` Loeliger Jon-LOELIGER
2007-04-26 1:34 ` Stephen Rothwell
0 siblings, 1 reply; 109+ messages in thread
From: Loeliger Jon-LOELIGER @ 2007-04-24 14:42 UTC (permalink / raw)
To: Stephen Rothwell, David S. Miller, paulus; +Cc: ppc-dev
> This requires creating dummy of_node_{get,put} routines for sparc and
> sparc64. It also adds a readlocal around the parent accesses.
>=20
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Perhaps a read lock?
jdl
^ permalink raw reply [flat|nested] 109+ messages in thread
* RE: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 13:27 ` [PATCH 1/6] Start split out of common open firmware code Segher Boessenkool
@ 2007-04-24 14:47 ` Loeliger Jon-LOELIGER
2007-04-24 18:04 ` David Miller
2007-04-25 0:03 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 109+ messages in thread
From: Loeliger Jon-LOELIGER @ 2007-04-24 14:47 UTC (permalink / raw)
To: Segher Boessenkool, Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
=20
> > +int of_n_addr_cells(struct device_node *np)
> > +{
> > + const int *ip;
> > +
> > + do {
> > + if (np->parent)
> > + np =3D np->parent;
> > + ip =3D of_get_property(np, "#address-cells", NULL);
> > + if (ip)
> > + return *ip;
> > + } while (np->parent);
> > + /* No #address-cells property for the root node */
> > + return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
> > +}
> > +EXPORT_SYMBOL(of_n_addr_cells);
>=20
> While I realise your patch is just moving stuff around,
> can this be fixed please? A missing "#address-cells"
> property means "two cells", not "inherit from parent".
> The few platforms with a broken tree should just be
> fixed (patch the tree in the bootwrapper, or perhaps
> _do_ use this workaround, but only on the affected
> platforms).
>=20
> > +int of_n_size_cells(struct device_node *np)
>=20
> Same here (the default is one cell though).
Agreed. We actually discussed this quite some time ago.
Thanks,
jdl
PS -- Any fixes for the DTC would be welcomed patches too! :-)
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 14:47 ` Loeliger Jon-LOELIGER
@ 2007-04-24 18:04 ` David Miller
2007-04-24 18:18 ` Segher Boessenkool
2007-04-25 0:07 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 109+ messages in thread
From: David Miller @ 2007-04-24 18:04 UTC (permalink / raw)
To: jdl; +Cc: sfr, paulus, linuxppc-dev
From: "Loeliger Jon-LOELIGER" <jdl@freescale.com>
Date: Tue, 24 Apr 2007 07:47:10 -0700
>
> > > +int of_n_addr_cells(struct device_node *np)
> > > +{
> > > + const int *ip;
> > > +
> > > + do {
> > > + if (np->parent)
> > > + np = np->parent;
> > > + ip = of_get_property(np, "#address-cells", NULL);
> > > + if (ip)
> > > + return *ip;
> > > + } while (np->parent);
> > > + /* No #address-cells property for the root node */
> > > + return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
> > > +}
> > > +EXPORT_SYMBOL(of_n_addr_cells);
> >
> > While I realise your patch is just moving stuff around,
> > can this be fixed please? A missing "#address-cells"
> > property means "two cells", not "inherit from parent".
> > The few platforms with a broken tree should just be
> > fixed (patch the tree in the bootwrapper, or perhaps
> > _do_ use this workaround, but only on the affected
> > platforms).
> >
> > > +int of_n_size_cells(struct device_node *np)
> >
> > Same here (the default is one cell though).
>
> Agreed. We actually discussed this quite some time ago.
I totally disagree that you should be changing anything
during these consolidations.
Move the code around in one pass where you can _VERIFY_
that things are precisely the same and won't break.
Then later you can get fancy and change things however you
wish.
You people giving comments like this have your priorities totally
screwed up and you are doing nothing but unnecessarily slowing down
this wonderful consolidation. Even worse you might even be giving
Stephen a disincentive to keep working actively on this.
So please STOP THIS CRAP now, thanks.
Everything so far is pure whining, and has nothing to do with
the substance of what Stephen is trying to accomplish, a
_CODE CONSOLIDATION_. So please don't get in the way of that
effort.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 18:04 ` David Miller
@ 2007-04-24 18:18 ` Segher Boessenkool
2007-04-24 19:14 ` Jon Loeliger
2007-04-25 0:07 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-24 18:18 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus, sfr
> I totally disagree that you should be changing anything
> during these consolidations.
And I didn't say so, I actually *said* I don't think
that should be done.
I was just remarking some really bad workarounds end
up in more generic code now, and as such need to be
fixed. Not now, but *later*.
> Move the code around in one pass where you can _VERIFY_
> that things are precisely the same and won't break.
>
> Then later you can get fancy and change things however you
> wish.
Yes exactly.
> Everything so far is pure whining, and has nothing to do with
> the substance of what Stephen is trying to accomplish, a
> _CODE CONSOLIDATION_. So please don't get in the way of that
> effort.
I'm not standing in the way here, I'm quite happy with
what Stephen is doing, great job.
I'm just pointing out some bugs/workarounds in the
merged code (that were there before, sure) -- it would
be lovely if they at least could be commented as being
not-quite-right in the new code so no one reading the
code will assume it is doing the "right thing".
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 18:18 ` Segher Boessenkool
@ 2007-04-24 19:14 ` Jon Loeliger
0 siblings, 0 replies; 109+ messages in thread
From: Jon Loeliger @ 2007-04-24 19:14 UTC (permalink / raw)
To: Segher Boessenkool
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras, David Miller, sfr
On Tue, 2007-04-24 at 13:18, Segher Boessenkool wrote:
> > I totally disagree that you should be changing anything
> > during these consolidations.
>
> And I didn't say so, I actually *said* I don't think
> that should be done.
>
> I was just remarking some really bad workarounds end
> up in more generic code now, and as such need to be
> fixed. Not now, but *later*.
>
> > Move the code around in one pass where you can _VERIFY_
> > that things are precisely the same and won't break.
> >
> > Then later you can get fancy and change things however you
> > wish.
>
> Yes exactly.
>
> > Everything so far is pure whining, and has nothing to do with
> > the substance of what Stephen is trying to accomplish, a
> > _CODE CONSOLIDATION_. So please don't get in the way of that
> > effort.
>
> I'm not standing in the way here, I'm quite happy with
> what Stephen is doing, great job.
>
> I'm just pointing out some bugs/workarounds in the
> merged code (that were there before, sure) -- it would
> be lovely if they at least could be commented as being
> not-quite-right in the new code so no one reading the
> code will assume it is doing the "right thing".
>
>
> Segher
And to be perfectly clear, I agreed with _Segher_
just as he outlines here.
Yes, it needs to be done. No, it does not happen
in this consolidation step. It happens in some
subsequent step that should not be forgotten.
jdl
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
` (5 preceding siblings ...)
2007-04-24 13:27 ` [PATCH 1/6] Start split out of common open firmware code Segher Boessenkool
@ 2007-04-24 23:35 ` David Miller
6 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-24 23:35 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 24 Apr 2007 22:32:45 +1000
> This creates drivers/openfw/base.c (depending on CONFIG_OPENFW) and puts
> the first trivially common bits from the prom.c files into it.
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
All 6 patches look great to me. Thanks Stephen.
I've been trying to think about how to ease the merging of
all of this stuff since it touches a bunch of platforms.
I'm happy to take care of all of this stuff in my sparc-2.6.22 GIT
tree at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.22.git
which I just rebased, if the PPC folks are fine with this.
If agreed, please just send over the PPC driver et al. patches from
the powerpc tree (ie. the get_property() renaming bits) and I'll suck
them into my sparc-2.6.22 tree.
If not agreed, we do have to come up with some kind of merge plan :-)
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 2/6] Consolidate of_device_is_compatible
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
2007-04-24 13:36 ` Segher Boessenkool
@ 2007-04-24 23:59 ` Benjamin Herrenschmidt
2007-04-25 4:23 ` David Miller
1 sibling, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-24 23:59 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Tue, 2007-04-24 at 22:38 +1000, Stephen Rothwell wrote:
> The only difference here is that Sparc uses strncmp to match compatibility
> names while PowerPC uses strncasecmp.
We should settle for a single implementation. In theory, strncmp would
be the way to go but there have been "bugs" here or there, especially in
Apple DTs, that made me use strncasecmp instead in the past.
Dave, what do you reckon ? I should try to find out the bogus machines
and add workarounds in the various drivers etc... instead or we can just
go common on strncasecmp ?
Ben.
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> arch/powerpc/kernel/prom.c | 25 -------------------------
> arch/sparc/kernel/prom.c | 21 ---------------------
> arch/sparc64/kernel/prom.c | 21 ---------------------
> drivers/openfw/base.c | 24 ++++++++++++++++++++++++
> include/asm-powerpc/prom.h | 2 ++
> include/asm-sparc/prom.h | 2 ++
> include/asm-sparc64/prom.h | 2 ++
> 7 files changed, 30 insertions(+), 67 deletions(-)
>
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index d701e89..723df55 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -1042,31 +1042,6 @@ void __init early_init_devtree(void *params)
>
> #undef printk
>
> -/** Checks if the given "compat" string matches one of the strings in
> - * the device's "compatible" property
> - */
> -int of_device_is_compatible(const struct device_node *device,
> - const char *compat)
> -{
> - const char* cp;
> - int cplen, l;
> -
> - cp = of_get_property(device, "compatible", &cplen);
> - if (cp == NULL)
> - return 0;
> - while (cplen > 0) {
> - if (strncasecmp(cp, compat, strlen(compat)) == 0)
> - return 1;
> - l = strlen(cp) + 1;
> - cp += l;
> - cplen -= l;
> - }
> -
> - return 0;
> -}
> -EXPORT_SYMBOL(of_device_is_compatible);
> -
> -
> /**
> * Indicates whether the root node has a given value in its
> * compatible property.
> diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
> index ac3f3c2..f2ce0d4 100644
> --- a/arch/sparc/kernel/prom.c
> +++ b/arch/sparc/kernel/prom.c
> @@ -32,27 +32,6 @@ static struct device_node *allnodes;
> */
> static DEFINE_RWLOCK(devtree_lock);
>
> -int of_device_is_compatible(const struct device_node *device,
> - const char *compat)
> -{
> - const char* cp;
> - int cplen, l;
> -
> - cp = of_get_property(device, "compatible", &cplen);
> - if (cp == NULL)
> - return 0;
> - while (cplen > 0) {
> - if (strncmp(cp, compat, strlen(compat)) == 0)
> - return 1;
> - l = strlen(cp) + 1;
> - cp += l;
> - cplen -= l;
> - }
> -
> - return 0;
> -}
> -EXPORT_SYMBOL(of_device_is_compatible);
> -
> struct device_node *of_get_parent(const struct device_node *node)
> {
> struct device_node *np;
> diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
> index 7ef5488..d6dd972 100644
> --- a/arch/sparc64/kernel/prom.c
> +++ b/arch/sparc64/kernel/prom.c
> @@ -36,27 +36,6 @@ static struct device_node *allnodes;
> */
> static DEFINE_RWLOCK(devtree_lock);
>
> -int of_device_is_compatible(const struct device_node *device,
> - const char *compat)
> -{
> - const char* cp;
> - int cplen, l;
> -
> - cp = of_get_property(device, "compatible", &cplen);
> - if (cp == NULL)
> - return 0;
> - while (cplen > 0) {
> - if (strncmp(cp, compat, strlen(compat)) == 0)
> - return 1;
> - l = strlen(cp) + 1;
> - cp += l;
> - cplen -= l;
> - }
> -
> - return 0;
> -}
> -EXPORT_SYMBOL(of_device_is_compatible);
> -
> struct device_node *of_get_parent(const struct device_node *node)
> {
> struct device_node *np;
> diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
> index 04a8cc2..0751313 100644
> --- a/drivers/openfw/base.c
> +++ b/drivers/openfw/base.c
> @@ -63,3 +63,27 @@ const void *of_get_property(const struct device_node *np, const char *name,
> return pp ? pp->value : NULL;
> }
> EXPORT_SYMBOL(of_get_property);
> +
> +/** Checks if the given "compat" string matches one of the strings in
> + * the device's "compatible" property
> + */
> +int of_device_is_compatible(const struct device_node *device,
> + const char *compat)
> +{
> + const char* cp;
> + int cplen, l;
> +
> + cp = of_get_property(device, "compatible", &cplen);
> + if (cp == NULL)
> + return 0;
> + while (cplen > 0) {
> + if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
> + return 1;
> + l = strlen(cp) + 1;
> + cp += l;
> + cplen -= l;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(of_device_is_compatible);
> diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
> index 30cea54..1f3e8cd 100644
> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -24,6 +24,8 @@
> #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> +#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
> +
> /* Definitions used by the flattened device tree */
> #define OF_DT_HEADER 0xd00dfeed /* marker */
> #define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
> diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
> index 411018d..cc049fd 100644
> --- a/include/asm-sparc/prom.h
> +++ b/include/asm-sparc/prom.h
> @@ -23,6 +23,8 @@
> #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> +#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> +
> typedef u32 phandle;
> typedef u32 ihandle;
>
> diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
> index 1097e66..843f9e8 100644
> --- a/include/asm-sparc64/prom.h
> +++ b/include/asm-sparc64/prom.h
> @@ -23,6 +23,8 @@
> #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> +#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> +
> typedef u32 phandle;
> typedef u32 ihandle;
>
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-24 12:39 ` [PATCH 3/6] Consolidate of_find_property Stephen Rothwell
2007-04-24 13:41 ` Segher Boessenkool
@ 2007-04-25 0:00 ` Benjamin Herrenschmidt
2007-04-25 0:43 ` Segher Boessenkool
2007-04-25 4:24 ` David Miller
1 sibling, 2 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 0:00 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Tue, 2007-04-24 at 22:39 +1000, Stephen Rothwell wrote:
> The only change here is that a readlock is taken while the property list
> is being traversed on Sparc where it was not taken previously.
>
> Also, Sparc uses strcasecmp to compare property names while PowerPC
> uses strcmp.
Ok, so that's the opposite as the previous one... property names are
supposed to be case sensitive though, no ? Dave, how do you think we
should converge here ? I don't think we would take much risk on ppc by
using strncasecmp but it shouldn't be necessary...
Ben.
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> arch/powerpc/kernel/prom.c | 24 +-----------------------
> arch/sparc/kernel/prom.c | 22 +---------------------
> arch/sparc64/kernel/prom.c | 22 +---------------------
> drivers/openfw/base.c | 26 ++++++++++++++++++++++++++
> include/asm-powerpc/prom.h | 1 +
> include/asm-sparc/prom.h | 1 +
> include/asm-sparc64/prom.h | 1 +
> 7 files changed, 32 insertions(+), 65 deletions(-)
>
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 723df55..939d5e4 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -79,10 +79,7 @@ struct boot_param_header *initial_boot_params;
>
> static struct device_node *allnodes = NULL;
>
> -/* use when traversing tree through the allnext, child, sibling,
> - * or parent members of struct device_node.
> - */
> -static DEFINE_RWLOCK(devtree_lock);
> +extern rwlock_t devtree_lock; /* temporary while merging */
>
> /* export that to outside world */
> struct device_node *of_chosen;
> @@ -1454,25 +1451,6 @@ static int __init prom_reconfig_setup(void)
> __initcall(prom_reconfig_setup);
> #endif
>
> -struct property *of_find_property(const struct device_node *np,
> - const char *name,
> - int *lenp)
> -{
> - struct property *pp;
> -
> - read_lock(&devtree_lock);
> - for (pp = np->properties; pp != 0; pp = pp->next)
> - if (strcmp(pp->name, name) == 0) {
> - if (lenp != 0)
> - *lenp = pp->length;
> - break;
> - }
> - read_unlock(&devtree_lock);
> -
> - return pp;
> -}
> -EXPORT_SYMBOL(of_find_property);
> -
> /*
> * Add a property to a node
> */
> diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
> index f2ce0d4..0f5aab4 100644
> --- a/arch/sparc/kernel/prom.c
> +++ b/arch/sparc/kernel/prom.c
> @@ -27,10 +27,7 @@
>
> static struct device_node *allnodes;
>
> -/* use when traversing tree through the allnext, child, sibling,
> - * or parent members of struct device_node.
> - */
> -static DEFINE_RWLOCK(devtree_lock);
> +extern rwlock_t devtree_lock; /* temporary while merging */
>
> struct device_node *of_get_parent(const struct device_node *node)
> {
> @@ -130,23 +127,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
> }
> EXPORT_SYMBOL(of_find_compatible_node);
>
> -struct property *of_find_property(const struct device_node *np,
> - const char *name,
> - int *lenp)
> -{
> - struct property *pp;
> -
> - for (pp = np->properties; pp != 0; pp = pp->next) {
> - if (strcasecmp(pp->name, name) == 0) {
> - if (lenp != 0)
> - *lenp = pp->length;
> - break;
> - }
> - }
> - return pp;
> -}
> -EXPORT_SYMBOL(of_find_property);
> -
> int of_getintprop_default(struct device_node *np, const char *name, int def)
> {
> struct property *prop;
> diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
> index d6dd972..c759660 100644
> --- a/arch/sparc64/kernel/prom.c
> +++ b/arch/sparc64/kernel/prom.c
> @@ -31,10 +31,7 @@
>
> static struct device_node *allnodes;
>
> -/* use when traversing tree through the allnext, child, sibling,
> - * or parent members of struct device_node.
> - */
> -static DEFINE_RWLOCK(devtree_lock);
> +extern rwlock_t devtree_lock; /* temporary while merging */
>
> struct device_node *of_get_parent(const struct device_node *node)
> {
> @@ -134,23 +131,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
> }
> EXPORT_SYMBOL(of_find_compatible_node);
>
> -struct property *of_find_property(const struct device_node *np,
> - const char *name,
> - int *lenp)
> -{
> - struct property *pp;
> -
> - for (pp = np->properties; pp != 0; pp = pp->next) {
> - if (strcasecmp(pp->name, name) == 0) {
> - if (lenp != 0)
> - *lenp = pp->length;
> - break;
> - }
> - }
> - return pp;
> -}
> -EXPORT_SYMBOL(of_find_property);
> -
> int of_getintprop_default(struct device_node *np, const char *name, int def)
> {
> struct property *prop;
> diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
> index 0751313..2597d29 100644
> --- a/drivers/openfw/base.c
> +++ b/drivers/openfw/base.c
> @@ -18,6 +18,12 @@
> */
> #include <linux/module.h>
> #include <linux/openfw.h>
> +#include <linux/spinlock.h>
> +
> +/* use when traversing tree through the allnext, child, sibling,
> + * or parent members of struct device_node.
> + */
> +DEFINE_RWLOCK(devtree_lock);
>
> int of_n_addr_cells(struct device_node *np)
> {
> @@ -51,6 +57,26 @@ int of_n_size_cells(struct device_node *np)
> }
> EXPORT_SYMBOL(of_n_size_cells);
>
> +struct property *of_find_property(const struct device_node *np,
> + const char *name,
> + int *lenp)
> +{
> + struct property *pp;
> +
> + read_lock(&devtree_lock);
> + for (pp = np->properties; pp != 0; pp = pp->next) {
> + if (of_prop_cmp(pp->name, name) == 0) {
> + if (lenp != 0)
> + *lenp = pp->length;
> + break;
> + }
> + }
> + read_unlock(&devtree_lock);
> +
> + return pp;
> +}
> +EXPORT_SYMBOL(of_find_property);
> +
> /*
> * Find a property with a given name for a given node
> * and return the value.
> diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
> index 1f3e8cd..a0679be 100644
> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -25,6 +25,7 @@
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
> +#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
>
> /* Definitions used by the flattened device tree */
> #define OF_DT_HEADER 0xd00dfeed /* marker */
> diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
> index cc049fd..d3dc05b 100644
> --- a/include/asm-sparc/prom.h
> +++ b/include/asm-sparc/prom.h
> @@ -24,6 +24,7 @@
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> +#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
>
> typedef u32 phandle;
> typedef u32 ihandle;
> diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
> index 843f9e8..a1b64e7 100644
> --- a/include/asm-sparc64/prom.h
> +++ b/include/asm-sparc64/prom.h
> @@ -24,6 +24,7 @@
> #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>
> #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> +#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
>
> typedef u32 phandle;
> typedef u32 ihandle;
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 6/6] Consolidate of_find_node_by routines
2007-04-24 12:43 ` [PATCH 6/6] Consolidate of_find_node_by routines Stephen Rothwell
@ 2007-04-25 0:01 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 0:01 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
On Tue, 2007-04-24 at 22:43 +1000, Stephen Rothwell wrote:
> This consolidates the routines of_find_node_by_path, of_find_node_by_name,
> of_find_node_by_type and of_find_compatible_device. Again, the comparison
> of strings are done differently by Sparc and PowerPC and also these add
> readlocks around the iterations.
Same question about how should we consolidate the string comparisons ?
In addition, we should really have a more intelligent path walker than
supports going down one level by name, unitaddress or both.
Ben.
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> arch/powerpc/kernel/prom.c | 113 +-------------------------------------------
> arch/sparc/kernel/prom.c | 61 +-----------------------
> arch/sparc64/kernel/prom.c | 61 +-----------------------
> drivers/openfw/base.c | 114 ++++++++++++++++++++++++++++++++++++++++++++
> include/asm-powerpc/prom.h | 1 +
> include/asm-sparc/prom.h | 1 +
> include/asm-sparc64/prom.h | 1 +
> 7 files changed, 120 insertions(+), 232 deletions(-)
>
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 90901e4..fc64bcb 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -77,7 +77,7 @@ static struct boot_param_header *initial_boot_params __initdata;
> struct boot_param_header *initial_boot_params;
> #endif
>
> -static struct device_node *allnodes = NULL;
> +extern struct device_node *allnodes; /* temporary while merging */
>
> extern rwlock_t devtree_lock; /* temporary while merging */
>
> @@ -1068,117 +1068,6 @@ EXPORT_SYMBOL(machine_is_compatible);
> *
> *******/
>
> -/**
> - * of_find_node_by_name - Find a node by its "name" property
> - * @from: The node to start searching from or NULL, the node
> - * you pass will not be searched, only the next one
> - * will; typically, you pass what the previous call
> - * returned. of_node_put() will be called on it
> - * @name: The name string to match against
> - *
> - * Returns a node pointer with refcount incremented, use
> - * of_node_put() on it when done.
> - */
> -struct device_node *of_find_node_by_name(struct device_node *from,
> - const char *name)
> -{
> - struct device_node *np;
> -
> - read_lock(&devtree_lock);
> - np = from ? from->allnext : allnodes;
> - for (; np != NULL; np = np->allnext)
> - if (np->name != NULL && strcasecmp(np->name, name) == 0
> - && of_node_get(np))
> - break;
> - of_node_put(from);
> - read_unlock(&devtree_lock);
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_name);
> -
> -/**
> - * of_find_node_by_type - Find a node by its "device_type" property
> - * @from: The node to start searching from or NULL, the node
> - * you pass will not be searched, only the next one
> - * will; typically, you pass what the previous call
> - * returned. of_node_put() will be called on it
> - * @name: The type string to match against
> - *
> - * Returns a node pointer with refcount incremented, use
> - * of_node_put() on it when done.
> - */
> -struct device_node *of_find_node_by_type(struct device_node *from,
> - const char *type)
> -{
> - struct device_node *np;
> -
> - read_lock(&devtree_lock);
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext)
> - if (np->type != 0 && strcasecmp(np->type, type) == 0
> - && of_node_get(np))
> - break;
> - of_node_put(from);
> - read_unlock(&devtree_lock);
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_type);
> -
> -/**
> - * of_find_compatible_node - Find a node based on type and one of the
> - * tokens in its "compatible" property
> - * @from: The node to start searching from or NULL, the node
> - * you pass will not be searched, only the next one
> - * will; typically, you pass what the previous call
> - * returned. of_node_put() will be called on it
> - * @type: The type string to match "device_type" or NULL to ignore
> - * @compatible: The string to match to one of the tokens in the device
> - * "compatible" list.
> - *
> - * Returns a node pointer with refcount incremented, use
> - * of_node_put() on it when done.
> - */
> -struct device_node *of_find_compatible_node(struct device_node *from,
> - const char *type, const char *compatible)
> -{
> - struct device_node *np;
> -
> - read_lock(&devtree_lock);
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext) {
> - if (type != NULL
> - && !(np->type != 0 && strcasecmp(np->type, type) == 0))
> - continue;
> - if (of_device_is_compatible(np, compatible) && of_node_get(np))
> - break;
> - }
> - of_node_put(from);
> - read_unlock(&devtree_lock);
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_compatible_node);
> -
> -/**
> - * of_find_node_by_path - Find a node matching a full OF path
> - * @path: The full path to match
> - *
> - * Returns a node pointer with refcount incremented, use
> - * of_node_put() on it when done.
> - */
> -struct device_node *of_find_node_by_path(const char *path)
> -{
> - struct device_node *np = allnodes;
> -
> - read_lock(&devtree_lock);
> - for (; np != 0; np = np->allnext) {
> - if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
> - && of_node_get(np))
> - break;
> - }
> - read_unlock(&devtree_lock);
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_path);
>
> /**
> * of_find_node_by_phandle - Find a node given a phandle
> diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
> index 3f8ccfa..012f983 100644
> --- a/arch/sparc/kernel/prom.c
> +++ b/arch/sparc/kernel/prom.c
> @@ -25,23 +25,10 @@
> #include <asm/prom.h>
> #include <asm/oplib.h>
>
> -static struct device_node *allnodes;
> +extern struct device_node *allnodes; /* temporary while merging */
>
> extern rwlock_t devtree_lock; /* temporary while merging */
>
> -struct device_node *of_find_node_by_path(const char *path)
> -{
> - struct device_node *np = allnodes;
> -
> - for (; np != 0; np = np->allnext) {
> - if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
> - break;
> - }
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_path);
> -
> struct device_node *of_find_node_by_phandle(phandle handle)
> {
> struct device_node *np;
> @@ -54,52 +41,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
> }
> EXPORT_SYMBOL(of_find_node_by_phandle);
>
> -struct device_node *of_find_node_by_name(struct device_node *from,
> - const char *name)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != NULL; np = np->allnext)
> - if (np->name != NULL && strcmp(np->name, name) == 0)
> - break;
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_name);
> -
> -struct device_node *of_find_node_by_type(struct device_node *from,
> - const char *type)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext)
> - if (np->type != 0 && strcmp(np->type, type) == 0)
> - break;
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_type);
> -
> -struct device_node *of_find_compatible_node(struct device_node *from,
> - const char *type, const char *compatible)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext) {
> - if (type != NULL
> - && !(np->type != 0 && strcmp(np->type, type) == 0))
> - continue;
> - if (of_device_is_compatible(np, compatible))
> - break;
> - }
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_compatible_node);
> -
> int of_getintprop_default(struct device_node *np, const char *name, int def)
> {
> struct property *prop;
> diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
> index be3b958..ae2065c 100644
> --- a/arch/sparc64/kernel/prom.c
> +++ b/arch/sparc64/kernel/prom.c
> @@ -29,23 +29,10 @@
> #include <asm/asi.h>
> #include <asm/upa.h>
>
> -static struct device_node *allnodes;
> +extern struct device_node *allnodes; /* temporary while merging */
>
> extern rwlock_t devtree_lock; /* temporary while merging */
>
> -struct device_node *of_find_node_by_path(const char *path)
> -{
> - struct device_node *np = allnodes;
> -
> - for (; np != 0; np = np->allnext) {
> - if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
> - break;
> - }
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_path);
> -
> struct device_node *of_find_node_by_phandle(phandle handle)
> {
> struct device_node *np;
> @@ -58,52 +45,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
> }
> EXPORT_SYMBOL(of_find_node_by_phandle);
>
> -struct device_node *of_find_node_by_name(struct device_node *from,
> - const char *name)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != NULL; np = np->allnext)
> - if (np->name != NULL && strcmp(np->name, name) == 0)
> - break;
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_name);
> -
> -struct device_node *of_find_node_by_type(struct device_node *from,
> - const char *type)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext)
> - if (np->type != 0 && strcmp(np->type, type) == 0)
> - break;
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_node_by_type);
> -
> -struct device_node *of_find_compatible_node(struct device_node *from,
> - const char *type, const char *compatible)
> -{
> - struct device_node *np;
> -
> - np = from ? from->allnext : allnodes;
> - for (; np != 0; np = np->allnext) {
> - if (type != NULL
> - && !(np->type != 0 && strcmp(np->type, type) == 0))
> - continue;
> - if (of_device_is_compatible(np, compatible))
> - break;
> - }
> -
> - return np;
> -}
> -EXPORT_SYMBOL(of_find_compatible_node);
> -
> int of_getintprop_default(struct device_node *np, const char *name, int def)
> {
> struct property *prop;
> diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
> index 60f7bd4..bb66e48 100644
> --- a/drivers/openfw/base.c
> +++ b/drivers/openfw/base.c
> @@ -20,6 +20,8 @@
> #include <linux/openfw.h>
> #include <linux/spinlock.h>
>
> +struct device_node *allnodes;
> +
> /* use when traversing tree through the allnext, child, sibling,
> * or parent members of struct device_node.
> */
> @@ -158,3 +160,115 @@ struct device_node *of_get_next_child(const struct device_node *node,
> return next;
> }
> EXPORT_SYMBOL(of_get_next_child);
> +
> +/**
> + * of_find_node_by_path - Find a node matching a full OF path
> + * @path: The full path to match
> + *
> + * Returns a node pointer with refcount incremented, use
> + * of_node_put() on it when done.
> + */
> +struct device_node *of_find_node_by_path(const char *path)
> +{
> + struct device_node *np = allnodes;
> +
> + read_lock(&devtree_lock);
> + for (; np; np = np->allnext) {
> + if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
> + && of_node_get(np))
> + break;
> + }
> + read_unlock(&devtree_lock);
> + return np;
> +}
> +EXPORT_SYMBOL(of_find_node_by_path);
> +
> +/**
> + * of_find_node_by_name - Find a node by its "name" property
> + * @from: The node to start searching from or NULL, the node
> + * you pass will not be searched, only the next one
> + * will; typically, you pass what the previous call
> + * returned. of_node_put() will be called on it
> + * @name: The name string to match against
> + *
> + * Returns a node pointer with refcount incremented, use
> + * of_node_put() on it when done.
> + */
> +struct device_node *of_find_node_by_name(struct device_node *from,
> + const char *name)
> +{
> + struct device_node *np;
> +
> + read_lock(&devtree_lock);
> + np = from ? from->allnext : allnodes;
> + for (; np; np = np->allnext)
> + if (np->name && (of_node_cmp(np->name, name) == 0)
> + && of_node_get(np))
> + break;
> + of_node_put(from);
> + read_unlock(&devtree_lock);
> + return np;
> +}
> +EXPORT_SYMBOL(of_find_node_by_name);
> +
> +/**
> + * of_find_node_by_type - Find a node by its "device_type" property
> + * @from: The node to start searching from or NULL, the node
> + * you pass will not be searched, only the next one
> + * will; typically, you pass what the previous call
> + * returned. of_node_put() will be called on it
> + * @name: The type string to match against
> + *
> + * Returns a node pointer with refcount incremented, use
> + * of_node_put() on it when done.
> + */
> +struct device_node *of_find_node_by_type(struct device_node *from,
> + const char *type)
> +{
> + struct device_node *np;
> +
> + read_lock(&devtree_lock);
> + np = from ? from->allnext : allnodes;
> + for (; np; np = np->allnext)
> + if (np->type && (of_node_cmp(np->type, type) == 0)
> + && of_node_get(np))
> + break;
> + of_node_put(from);
> + read_unlock(&devtree_lock);
> + return np;
> +}
> +EXPORT_SYMBOL(of_find_node_by_type);
> +
> +/**
> + * of_find_compatible_node - Find a node based on type and one of the
> + * tokens in its "compatible" property
> + * @from: The node to start searching from or NULL, the node
> + * you pass will not be searched, only the next one
> + * will; typically, you pass what the previous call
> + * returned. of_node_put() will be called on it
> + * @type: The type string to match "device_type" or NULL to ignore
> + * @compatible: The string to match to one of the tokens in the device
> + * "compatible" list.
> + *
> + * Returns a node pointer with refcount incremented, use
> + * of_node_put() on it when done.
> + */
> +struct device_node *of_find_compatible_node(struct device_node *from,
> + const char *type, const char *compatible)
> +{
> + struct device_node *np;
> +
> + read_lock(&devtree_lock);
> + np = from ? from->allnext : allnodes;
> + for (; np; np = np->allnext) {
> + if (type
> + && !(np->type && (of_node_cmp(np->type, type) == 0)))
> + continue;
> + if (of_device_is_compatible(np, compatible) && of_node_get(np))
> + break;
> + }
> + of_node_put(from);
> + read_unlock(&devtree_lock);
> + return np;
> +}
> +EXPORT_SYMBOL(of_find_compatible_node);
> diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
> index a0679be..d0ff917 100644
> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -26,6 +26,7 @@
>
> #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
> #define of_prop_cmp(s1, s2) strcmp((s1), (s2))
> +#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
>
> /* Definitions used by the flattened device tree */
> #define OF_DT_HEADER 0xd00dfeed /* marker */
> diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
> index 4621af6..92919ac 100644
> --- a/include/asm-sparc/prom.h
> +++ b/include/asm-sparc/prom.h
> @@ -25,6 +25,7 @@
>
> #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
> +#define of_node_cmp(s1, s2) strcmp((s1), (s2))
>
> typedef u32 phandle;
> typedef u32 ihandle;
> diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
> index c36b884..d2123c2 100644
> --- a/include/asm-sparc64/prom.h
> +++ b/include/asm-sparc64/prom.h
> @@ -25,6 +25,7 @@
>
> #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
> #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
> +#define of_node_cmp(s1, s2) strcmp((s1), (s2))
>
> typedef u32 phandle;
> typedef u32 ihandle;
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 13:27 ` [PATCH 1/6] Start split out of common open firmware code Segher Boessenkool
2007-04-24 14:47 ` Loeliger Jon-LOELIGER
@ 2007-04-25 0:03 ` Benjamin Herrenschmidt
2007-04-25 0:50 ` Segher Boessenkool
1 sibling, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 0:03 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Stephen Rothwell, paulus, David S. Miller, ppc-dev
> While I realise your patch is just moving stuff around,
> can this be fixed please? A missing "#address-cells"
> property means "two cells", not "inherit from parent".
> The few platforms with a broken tree should just be
> fixed (patch the tree in the bootwrapper, or perhaps
> _do_ use this workaround, but only on the affected
> platforms).
If you can get me access to all of the old PowerMac or CHRP crap with
broken device-tree's ...
Note that I don't think there's much cases of such breakage on the
field, but I'd be annoyed to change a behaviour we had from day 1.
> > +int of_n_size_cells(struct device_node *np)
>
> Same here (the default is one cell though).
And same comment.
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-24 18:04 ` David Miller
2007-04-24 18:18 ` Segher Boessenkool
@ 2007-04-25 0:07 ` Benjamin Herrenschmidt
2007-04-25 1:03 ` Segher Boessenkool
1 sibling, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 0:07 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
> I totally disagree that you should be changing anything
> during these consolidations.
>
> Move the code around in one pass where you can _VERIFY_
> that things are precisely the same and won't break.
>
> Then later you can get fancy and change things however you
> wish.
Oh I think we all agree there... we just use the opportunity to discuss
how we should improve the consolidation further :-)
> You people giving comments like this have your priorities totally
> screwed up and you are doing nothing but unnecessarily slowing down
> this wonderful consolidation. Even worse you might even be giving
> Stephen a disincentive to keep working actively on this.
>
> So please STOP THIS CRAP now, thanks.
>
> Everything so far is pure whining, and has nothing to do with
> the substance of what Stephen is trying to accomplish, a
> _CODE CONSOLIDATION_. So please don't get in the way of that
> effort.
Dave, no need to shout :-) I think it's pretty well agreed that
Stephen's patches are good to go (unless nits I haven't seen), we are
really just discussing what we should do on top of them.
Now regarding the parsing of #address-cells / #size-cells, it's indeed a
bug that we walk up the tree on powerpc, we did that initially, I think,
due to a misunderstanding of the spec, but since the code's been doing
that forever, nobody ever wanted to change it and take the risk to break
it.
At one point, I suppose we'll have to bit the bullet and do a patch
going to the proper behaviour and see what breaks (probably nothing
nowadays, except maybe some rare old apple mac-io stuffs that I need to
double check) but that should definitely be done separately from the
consolidation.
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 0:00 ` Benjamin Herrenschmidt
@ 2007-04-25 0:43 ` Segher Boessenkool
2007-04-25 1:12 ` Benjamin Herrenschmidt
2007-04-25 4:24 ` David Miller
1 sibling, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 0:43 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: ppc-dev, paulus, David S. Miller, Stephen Rothwell
>> The only change here is that a readlock is taken while the property
>> list
>> is being traversed on Sparc where it was not taken previously.
>>
>> Also, Sparc uses strcasecmp to compare property names while PowerPC
>> uses strcmp.
>
> Ok, so that's the opposite as the previous one... property names are
> supposed to be case sensitive though, no ?
The OF standard doesn't allow upper case in property
names at all.
> I don't think we would take much risk on ppc by
> using strncasecmp but it shouldn't be necessary...
There are some examples where upper case is actually
used in property names, unfortunately. These can
be solved by renaming/copying those properties to
all lower case in a bootwrapper, or by strcmp() to
the "cased" string, or by strcasecmp(). I for one
don't like either option, you figure it out ;-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 0:03 ` Benjamin Herrenschmidt
@ 2007-04-25 0:50 ` Segher Boessenkool
2007-04-25 1:51 ` Josh Boyer
2007-04-25 4:27 ` David Miller
0 siblings, 2 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 0:50 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: ppc-dev, paulus, David S. Miller, Stephen Rothwell
>> While I realise your patch is just moving stuff around,
>> can this be fixed please? A missing "#address-cells"
>> property means "two cells", not "inherit from parent".
>> The few platforms with a broken tree should just be
>> fixed (patch the tree in the bootwrapper, or perhaps
>> _do_ use this workaround, but only on the affected
>> platforms).
>
> If you can get me access to all of the old PowerMac or CHRP crap with
> broken device-tree's ...
No I can't, which is exactly why I cannot fix it myself.
> Note that I don't think there's much cases of such breakage on the
> field,
For PowerPC it is mostly the G3 PowerMacs I believe.
The SPARC tree carries the same broken code -- is
this just a case of code copying, or are there
actual SPARC machines with such broken trees?
> but I'd be annoyed to change a behaviour we had from day 1.
Yes exactly -- we shouldn't just completely break
the kernel working on those machines. Of course,
if no tester can be found, perhaps support for
those boxes should just be abandoned.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 0:07 ` Benjamin Herrenschmidt
@ 2007-04-25 1:03 ` Segher Boessenkool
2007-04-25 4:29 ` David Miller
0 siblings, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 1:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus, David Miller, sfr
> Dave, no need to shout :-) I think it's pretty well agreed that
> Stephen's patches are good to go (unless nits I haven't seen), we are
> really just discussing what we should do on top of them.
Yes. And I dare say that we should agree that certain
fixes *should* go on top or this consolidation shouldn't
happen at all -- at least not as a consolidation to a
"generic" OF layer. For example, the OLPC device tree / OF
kernel efforts would be dead in the water if we cannot
have a *proper* "#address-cells" parser.
Again, I have *nothing* against Stephen's patches, I find
them quite nice actually. It's just that if this stuff
gets moved to a "for all archs" layer, some "design
qualms" need to be cleared up; either that, or we'll
end up with the OF analogue to an MSI layer that only
ever can work on intel compatible platforms.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 0:43 ` Segher Boessenkool
@ 2007-04-25 1:12 ` Benjamin Herrenschmidt
2007-04-25 2:03 ` Segher Boessenkool
0 siblings, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 1:12 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: ppc-dev, paulus, David S. Miller, Stephen Rothwell
On Wed, 2007-04-25 at 02:43 +0200, Segher Boessenkool wrote:
> The OF standard doesn't allow upper case in property
> names at all.
Ok, fair enough, but in practice, they exist :-)
> > I don't think we would take much risk on ppc by
> > using strncasecmp but it shouldn't be necessary...
>
> There are some examples where upper case is actually
> used in property names, unfortunately. These can
> be solved by renaming/copying those properties to
> all lower case in a bootwrapper, or by strcmp() to
> the "cased" string, or by strcasecmp(). I for one
> don't like either option, you figure it out ;-)
Oh well, I don't care either way though fixup from bootwrapper doesn't
appeal to me at all...
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-24 13:41 ` Segher Boessenkool
@ 2007-04-25 1:43 ` Paul Mackerras
2007-04-25 2:10 ` Segher Boessenkool
` (2 more replies)
0 siblings, 3 replies; 109+ messages in thread
From: Paul Mackerras @ 2007-04-25 1:43 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Stephen Rothwell, David S. Miller, ppc-dev
Segher Boessenkool writes:
> Property names aren't supposed to contain uppercase
> characters.
Somebody forgot to tell Apple:
$ ls /proc/device-tree/ht@0,f2000000/pci@9/ata-6@d
total 23
1 #address-cells 1 cable-type 1 interrupt-parent 1 name
1 #size-cells 1 class-code 1 interrupts 1 reg
1 AAPL,bus-id 1 compatible 0 lba-48 1 revision-id
1 AAPL,connector 1 device-id 1 linux,phandle 1 vendor-id
1 AAPL,pio-timing 1 device_type 1 max-latency
1 AAPL,requested-priorities 1 devsel-speed 1 min-grant
1 assigned-addresses 0 disk/ 1 model
> I can swing both ways on which of strcmp()
> or strcasecmp() is better, but there seems no reason
> to do this differently on each platform.
The question is, what ppc drivers would break if we used strcmp
instead of strcasecmp? I have a dim memory that some Apple machines
had "ata" and others had "ATA" for the hard disk, for instance.
Paul.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 0:50 ` Segher Boessenkool
@ 2007-04-25 1:51 ` Josh Boyer
2007-04-25 2:07 ` Segher Boessenkool
2007-04-25 4:27 ` David Miller
1 sibling, 1 reply; 109+ messages in thread
From: Josh Boyer @ 2007-04-25 1:51 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Stephen Rothwell, paulus, David S. Miller, ppc-dev
On Wed, Apr 25, 2007 at 02:50:13AM +0200, Segher Boessenkool wrote:
> >> While I realise your patch is just moving stuff around,
> >> can this be fixed please? A missing "#address-cells"
> >> property means "two cells", not "inherit from parent".
> >> The few platforms with a broken tree should just be
> >> fixed (patch the tree in the bootwrapper, or perhaps
> >> _do_ use this workaround, but only on the affected
> >> platforms).
> >
> > If you can get me access to all of the old PowerMac or CHRP crap with
> > broken device-tree's ...
>
> No I can't, which is exactly why I cannot fix it myself.
>
> > Note that I don't think there's much cases of such breakage on the
> > field,
>
> For PowerPC it is mostly the G3 PowerMacs I believe.
I have one of those. What exactly do you need from it? I can probably do
some testing with it if needs be.
josh
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 1:12 ` Benjamin Herrenschmidt
@ 2007-04-25 2:03 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 2:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: ppc-dev, paulus, David S. Miller, Stephen Rothwell
>> The OF standard doesn't allow upper case in property
>> names at all.
>
> Ok, fair enough, but in practice, they exist :-)
Yes.
>>> I don't think we would take much risk on ppc by
>>> using strncasecmp but it shouldn't be necessary...
>>
>> There are some examples where upper case is actually
>> used in property names, unfortunately. These can
>> be solved by renaming/copying those properties to
>> all lower case in a bootwrapper, or by strcmp() to
>> the "cased" string, or by strcasecmp(). I for one
>> don't like either option, you figure it out ;-)
>
> Oh well, I don't care either way though fixup from bootwrapper doesn't
> appeal to me at all...
It doesn't to me either, not for this isolated case;
but when looking at the bigger picture, all the really
bad dev tree problems we need to work around on certain
platforms, it starts to sound appealing. And when you
start doing some fixes in a bootwrapper, why not all.
Just something to think about.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 1:51 ` Josh Boyer
@ 2007-04-25 2:07 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 2:07 UTC (permalink / raw)
To: Josh Boyer; +Cc: Stephen Rothwell, paulus, David S. Miller, ppc-dev
>>> If you can get me access to all of the old PowerMac or CHRP crap with
>>> broken device-tree's ...
>>
>> No I can't, which is exactly why I cannot fix it myself.
>>
>>> Note that I don't think there's much cases of such breakage on the
>>> field,
>>
>> For PowerPC it is mostly the G3 PowerMacs I believe.
>
> I have one of those. What exactly do you need from it? I can
> probably do
> some testing with it if needs be.
I'll cook up a patch when Stephen's patch series hits
a Git tree. Testing would basically be trying to run
a kernel with all possible devices enabled, and seeing
if they all still work as expected.
Thanks for offering your help! Let's see what happens
next week or so :-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 1:43 ` Paul Mackerras
@ 2007-04-25 2:10 ` Segher Boessenkool
2007-04-25 4:31 ` David Miller
2007-04-25 5:07 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 2:10 UTC (permalink / raw)
To: Paul Mackerras; +Cc: ppc-dev, David S. Miller, Stephen Rothwell
>> Property names aren't supposed to contain uppercase
>> characters.
>
> Somebody forgot to tell Apple:
Yes I know. Sigh.
>> I can swing both ways on which of strcmp()
>> or strcasecmp() is better, but there seems no reason
>> to do this differently on each platform.
>
> The question is, what ppc drivers would break if we used strcmp
> instead of strcasecmp? I have a dim memory that some Apple machines
> had "ata" and others had "ATA" for the hard disk, for instance.
Hrm I don't remember that one, but yeah something
similar is bound to prop up.
The question is, should we use strcasecmp(), or adjust
those drivers to probe for the upper case version
in addition to the lower case version? That option
at least has the advantage that you can document
the workaround right where the actual problem is met :-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 2/6] Consolidate of_device_is_compatible
2007-04-24 23:59 ` Benjamin Herrenschmidt
@ 2007-04-25 4:23 ` David Miller
0 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-25 4:23 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed, 25 Apr 2007 09:59:24 +1000
> On Tue, 2007-04-24 at 22:38 +1000, Stephen Rothwell wrote:
> > The only difference here is that Sparc uses strncmp to match compatibility
> > names while PowerPC uses strncasecmp.
>
> We should settle for a single implementation. In theory, strncmp would
> be the way to go but there have been "bugs" here or there, especially in
> Apple DTs, that made me use strncasecmp instead in the past.
>
> Dave, what do you reckon ? I should try to find out the bogus machines
> and add workarounds in the various drivers etc... instead or we can just
> go common on strncasecmp ?
I think strncasecmp is the safest thing to start with.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 0:00 ` Benjamin Herrenschmidt
2007-04-25 0:43 ` Segher Boessenkool
@ 2007-04-25 4:24 ` David Miller
1 sibling, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-25 4:24 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed, 25 Apr 2007 10:00:35 +1000
> On Tue, 2007-04-24 at 22:39 +1000, Stephen Rothwell wrote:
> > The only change here is that a readlock is taken while the property list
> > is being traversed on Sparc where it was not taken previously.
> >
> > Also, Sparc uses strcasecmp to compare property names while PowerPC
> > uses strcmp.
>
> Ok, so that's the opposite as the previous one... property names are
> supposed to be case sensitive though, no ? Dave, how do you think we
> should converge here ? I don't think we would take much risk on ppc by
> using strncasecmp but it shouldn't be necessary...
The difference is that some properties are all-caps on powerpc
when they are lowecase on sparc, the Radeon properties are a
good example.
I think if we use strncasecmp across the board, nothing will
break.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 0:50 ` Segher Boessenkool
2007-04-25 1:51 ` Josh Boyer
@ 2007-04-25 4:27 ` David Miller
2007-04-25 13:07 ` Segher Boessenkool
1 sibling, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-25 4:27 UTC (permalink / raw)
To: segher; +Cc: sfr, paulus, linuxppc-dev
From: Segher Boessenkool <segher@kernel.crashing.org>
Date: Wed, 25 Apr 2007 02:50:13 +0200
> The SPARC tree carries the same broken code -- is
> this just a case of code copying, or are there
> actual SPARC machines with such broken trees?
There have been many cases of missed or even erroneous
properties on sparc tree, but I am not too sure about
the cell counting cases.
Let's do this, once the consolidation is done keeping
behavior as-is, give me a patch to review that changing
the cell counting bits and I'll verify it against
all the machines I have here plus some OFW tree dumps.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 1:03 ` Segher Boessenkool
@ 2007-04-25 4:29 ` David Miller
2007-04-25 13:11 ` Segher Boessenkool
0 siblings, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-25 4:29 UTC (permalink / raw)
To: segher; +Cc: sfr, paulus, linuxppc-dev
From: Segher Boessenkool <segher@kernel.crashing.org>
Date: Wed, 25 Apr 2007 03:03:31 +0200
> end up with the OF analogue to an MSI layer that only
> ever can work on intel compatible platforms.
Please don't use this straw-man.
These days it works perfectly fine on sparc64.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 1:43 ` Paul Mackerras
2007-04-25 2:10 ` Segher Boessenkool
@ 2007-04-25 4:31 ` David Miller
2007-04-25 5:07 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-25 4:31 UTC (permalink / raw)
To: paulus; +Cc: sfr, linuxppc-dev
From: Paul Mackerras <paulus@samba.org>
Date: Wed, 25 Apr 2007 11:43:41 +1000
> The question is, what ppc drivers would break if we used strcmp
> instead of strcasecmp? I have a dim memory that some Apple machines
> had "ata" and others had "ATA" for the hard disk, for instance.
To be honest, I am sure there are a lot more examples of this
on Apple machines.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 1:43 ` Paul Mackerras
2007-04-25 2:10 ` Segher Boessenkool
2007-04-25 4:31 ` David Miller
@ 2007-04-25 5:07 ` Benjamin Herrenschmidt
2007-04-25 13:13 ` Segher Boessenkool
2 siblings, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 5:07 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Stephen Rothwell, David S. Miller, ppc-dev
> The question is, what ppc drivers would break if we used strcmp
> instead of strcasecmp? I have a dim memory that some Apple machines
> had "ata" and others had "ATA" for the hard disk, for instance.
ata/ATA and ide/IDE is the main one that comes to mind, but I wouldn't
exclude something like Powermac vs. PowerMac or that sort of thing... I
remember a case related bug about 2 years ago but can't find what it
was ...
I think it's safe to settle on strcasecmp for most things for now
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 4:27 ` David Miller
@ 2007-04-25 13:07 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 13:07 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
>> The SPARC tree carries the same broken code -- is
>> this just a case of code copying, or are there
>> actual SPARC machines with such broken trees?
>
> There have been many cases of missed or even erroneous
> properties on sparc tree, but I am not too sure about
> the cell counting cases.
>
> Let's do this, once the consolidation is done keeping
> behavior as-is, give me a patch to review that changing
> the cell counting bits and I'll verify it against
> all the machines I have here plus some OFW tree dumps.
Okay, good plan. Let's try this as soon as the current
patch series hits the powerpc tree.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 1/6] Start split out of common open firmware code
2007-04-25 4:29 ` David Miller
@ 2007-04-25 13:11 ` Segher Boessenkool
0 siblings, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 13:11 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
>> end up with the OF analogue to an MSI layer that only
>> ever can work on intel compatible platforms.
>
> Please don't use this straw-man.
>
> These days it works perfectly fine on sparc64.
Yes, but how long did that take? And why? That's my
point, not that "after this things cannot be solved
anymore" -- sure they can, it gets a lot harder though.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 5:07 ` Benjamin Herrenschmidt
@ 2007-04-25 13:13 ` Segher Boessenkool
2007-04-25 17:46 ` Matt Sealey
0 siblings, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 13:13 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: ppc-dev, Paul Mackerras, David S. Miller, Stephen Rothwell
>> The question is, what ppc drivers would break if we used strcmp
>> instead of strcasecmp? I have a dim memory that some Apple machines
>> had "ata" and others had "ATA" for the hard disk, for instance.
>
> ata/ATA and ide/IDE is the main one that comes to mind, but I wouldn't
> exclude something like Powermac vs. PowerMac or that sort of thing... I
> remember a case related bug about 2 years ago but can't find what it
> was ...
>
> I think it's safe to settle on strcasecmp for most things for now
Yes, it's hard to imagine any case where strcasecmp(),
although technically incorrect, would break anything.
Please document in the code that is _is_ wrong and _why_
it is done though.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 13:13 ` Segher Boessenkool
@ 2007-04-25 17:46 ` Matt Sealey
2007-04-25 19:02 ` Segher Boessenkool
2007-04-25 22:16 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 109+ messages in thread
From: Matt Sealey @ 2007-04-25 17:46 UTC (permalink / raw)
To: Segher Boessenkool
Cc: Stephen Rothwell, Paul Mackerras, David S. Miller, ppc-dev
Can't the ata/ATA thing be fixed by simply fixing device trees where it
happens? strncmp seems the standards-compliant route to take.. why clutter
the common parsing routines with fixes for deviant platforms?
The Mac obviously has a few of_platform things where you can add a
compatible search for ata then ATA, keeping it all in the drivers (where
relevant) and in the platform setup (where necessary)
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
Segher Boessenkool wrote:
>>> The question is, what ppc drivers would break if we used strcmp
>>> instead of strcasecmp? I have a dim memory that some Apple machines
>>> had "ata" and others had "ATA" for the hard disk, for instance.
>> ata/ATA and ide/IDE is the main one that comes to mind, but I wouldn't
>> exclude something like Powermac vs. PowerMac or that sort of thing... I
>> remember a case related bug about 2 years ago but can't find what it
>> was ...
>>
>> I think it's safe to settle on strcasecmp for most things for now
>
> Yes, it's hard to imagine any case where strcasecmp(),
> although technically incorrect, would break anything.
> Please document in the code that is _is_ wrong and _why_
> it is done though.
>
>
> Segher
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 17:46 ` Matt Sealey
@ 2007-04-25 19:02 ` Segher Boessenkool
2007-04-25 22:16 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 19:02 UTC (permalink / raw)
To: Matt Sealey; +Cc: Stephen Rothwell, Paul Mackerras, David S. Miller, ppc-dev
Don't top-post. Thank you.
> Can't the ata/ATA thing be fixed by simply fixing device trees where it
> happens? strncmp seems the standards-compliant route to take..
Sure it can. But for now, strcasecmp() is the
best route to take, at least for powerpc (it
preserves the existing behaviour). Can't change
everything at once, every single change can
potentially break some platforms. One step at a
time.
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 17:46 ` Matt Sealey
2007-04-25 19:02 ` Segher Boessenkool
@ 2007-04-25 22:16 ` Benjamin Herrenschmidt
2007-04-25 22:24 ` David Miller
1 sibling, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 22:16 UTC (permalink / raw)
To: Matt Sealey; +Cc: ppc-dev, Paul Mackerras, David S. Miller, Stephen Rothwell
On Wed, 2007-04-25 at 18:46 +0100, Matt Sealey wrote:
> Can't the ata/ATA thing be fixed by simply fixing device trees where it
> happens? strncmp seems the standards-compliant route to take.. why clutter
> the common parsing routines with fixes for deviant platforms?
In that specific case, it's even fixed by having the driver have both
spellings in it's match list.
> The Mac obviously has a few of_platform things where you can add a
> compatible search for ata then ATA, keeping it all in the drivers (where
> relevant) and in the platform setup (where necessary)
The main problem with dropping case insensitive comparison is finding
all the other cases of broken device-trees and make sure we have
appropriate workarounds. I don't have access to all of the old apple
machines (though I have access to a quite nice sample of them) and I
generally dislike breaking something that works :-)
But I agree that in the long run, it's a better approach
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 22:16 ` Benjamin Herrenschmidt
@ 2007-04-25 22:24 ` David Miller
2007-04-25 22:47 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 109+ messages in thread
From: David Miller @ 2007-04-25 22:24 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 26 Apr 2007 08:16:44 +1000
> On Wed, 2007-04-25 at 18:46 +0100, Matt Sealey wrote:
>
> > Can't the ata/ATA thing be fixed by simply fixing device trees where it
> > happens? strncmp seems the standards-compliant route to take.. why clutter
> > the common parsing routines with fixes for deviant platforms?
>
> In that specific case, it's even fixed by having the driver have both
> spellings in it's match list.
This is something I'd like to avoid.
Initially I added sparc OFW property support to the Radeon
driver by checking for both the upper-case and lower-case
variants of all the property names.
It was beyond ugly.
I know we are talking about node names, not properties, here but
I think the same logic and reasoning applies.
> But I agree that in the long run, it's a better approach
Maybe.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 22:24 ` David Miller
@ 2007-04-25 22:47 ` Benjamin Herrenschmidt
2007-04-25 23:13 ` David Miller
0 siblings, 1 reply; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 22:47 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
On Wed, 2007-04-25 at 15:24 -0700, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Thu, 26 Apr 2007 08:16:44 +1000
>
> > On Wed, 2007-04-25 at 18:46 +0100, Matt Sealey wrote:
> >
> > > Can't the ata/ATA thing be fixed by simply fixing device trees where it
> > > happens? strncmp seems the standards-compliant route to take.. why clutter
> > > the common parsing routines with fixes for deviant platforms?
> >
> > In that specific case, it's even fixed by having the driver have both
> > spellings in it's match list.
>
> This is something I'd like to avoid.
>
> Initially I added sparc OFW property support to the Radeon
> driver by checking for both the upper-case and lower-case
> variants of all the property names.
>
> It was beyond ugly.
Well, I think we are mixing several things in the same pot here :-)
- property names. That's what you had to deal with for Sparc. I think
it's fair enough to use strcasecmp for these. They are supposed to not
have case, while they happen to do here or there, there is almost no
chance of conflict (several properties with a name differring only by
the case).
- property content. (That include node names which are really only the
content of the "name" property of that node). The ATA/ata case was for
property content in fact (name property and type property iirc) which is
a different thing and must be kept case sensitive I beleive. That covers
the case of of_device_is_compatible() which should use strcmp (or the
-n- version of it of course).
Do we agree on that ?
Cheers,
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 22:47 ` Benjamin Herrenschmidt
@ 2007-04-25 23:13 ` David Miller
2007-04-25 23:18 ` Segher Boessenkool
` (2 more replies)
0 siblings, 3 replies; 109+ messages in thread
From: David Miller @ 2007-04-25 23:13 UTC (permalink / raw)
To: benh; +Cc: sfr, paulus, linuxppc-dev
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 26 Apr 2007 08:47:45 +1000
> - property names. That's what you had to deal with for Sparc. I think
> it's fair enough to use strcasecmp for these. They are supposed to not
> have case, while they happen to do here or there, there is almost no
> chance of conflict (several properties with a name differring only by
> the case).
>
> - property content. (That include node names which are really only the
> content of the "name" property of that node). The ATA/ata case was for
> property content in fact (name property and type property iirc) which is
> a different thing and must be kept case sensitive I beleive. That covers
> the case of of_device_is_compatible() which should use strcmp (or the
> -n- version of it of course).
>
> Do we agree on that ?
Ok, I think so.
Meanwhile any feedback on the idea of pushing all of this
consolidation and cleanup work through one of our trees
instead of having all of these difficult dependencies
between the two?
Thanks.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 23:13 ` David Miller
@ 2007-04-25 23:18 ` Segher Boessenkool
2007-04-25 23:28 ` David Miller
2007-04-25 23:21 ` Benjamin Herrenschmidt
2007-04-26 5:54 ` Stephen Rothwell
2 siblings, 1 reply; 109+ messages in thread
From: Segher Boessenkool @ 2007-04-25 23:18 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, sfr, paulus
> Meanwhile any feedback on the idea of pushing all of this
> consolidation and cleanup work through one of our trees
> instead of having all of these difficult dependencies
> between the two?
Set up a branch in one of the Git repos that is for
this consolidation work only, that both the arch trees
can pull from? The beauty with Git is that this won't
lead to merge problems :-)
Segher
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 23:13 ` David Miller
2007-04-25 23:18 ` Segher Boessenkool
@ 2007-04-25 23:21 ` Benjamin Herrenschmidt
2007-04-26 5:54 ` Stephen Rothwell
2 siblings, 0 replies; 109+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-25 23:21 UTC (permalink / raw)
To: David Miller; +Cc: sfr, paulus, linuxppc-dev
> Meanwhile any feedback on the idea of pushing all of this
> consolidation and cleanup work through one of our trees
> instead of having all of these difficult dependencies
> between the two?
I'll leave that between you, paulus and stephen as I'm working on
something else at the moment :-)
Ben.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 23:18 ` Segher Boessenkool
@ 2007-04-25 23:28 ` David Miller
0 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-25 23:28 UTC (permalink / raw)
To: segher; +Cc: linuxppc-dev, sfr, paulus
From: Segher Boessenkool <segher@kernel.crashing.org>
Date: Thu, 26 Apr 2007 01:18:59 +0200
> > Meanwhile any feedback on the idea of pushing all of this
> > consolidation and cleanup work through one of our trees
> > instead of having all of these difficult dependencies
> > between the two?
>
> Set up a branch in one of the Git repos that is for
> this consolidation work only, that both the arch trees
> can pull from? The beauty with Git is that this won't
> lead to merge problems :-)
I rebase my GIT tree as patches very often, and I have many direct
dependencies on this work both at the beginning and further along in
my tree.
So this won't work, that's why I haven't suggested it.
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 4/6] Consolidate of_get_parent
2007-04-24 14:42 ` Loeliger Jon-LOELIGER
@ 2007-04-26 1:34 ` Stephen Rothwell
0 siblings, 0 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-26 1:34 UTC (permalink / raw)
To: Loeliger Jon-LOELIGER; +Cc: ppc-dev, paulus, David S. Miller
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Tue, 24 Apr 2007 07:42:56 -0700 "Loeliger Jon-LOELIGER" <jdl@freescale.com> wrote:
>
> > sparc64. It also adds a readlocal around the parent accesses.
> >
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> Perhaps a read lock?
Yeah, just a small typo :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-25 23:13 ` David Miller
2007-04-25 23:18 ` Segher Boessenkool
2007-04-25 23:21 ` Benjamin Herrenschmidt
@ 2007-04-26 5:54 ` Stephen Rothwell
2007-04-26 5:58 ` David Miller
2 siblings, 1 reply; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-26 5:54 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, paulus
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
Hi Dave,
On Wed, 25 Apr 2007 16:13:09 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> Meanwhile any feedback on the idea of pushing all of this
> consolidation and cleanup work through one of our trees
> instead of having all of these difficult dependencies
> between the two?
Seems the Linus has fixed this problem for us :-)
If you and Paul can get your for-2.6.22 trees pulled by Linus, I can
submit the remaining patches to Linus (with your and Paul's blessing, of
course).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 109+ messages in thread
* Re: [PATCH 3/6] Consolidate of_find_property
2007-04-26 5:54 ` Stephen Rothwell
@ 2007-04-26 5:58 ` David Miller
0 siblings, 0 replies; 109+ messages in thread
From: David Miller @ 2007-04-26 5:58 UTC (permalink / raw)
To: sfr; +Cc: linuxppc-dev, paulus
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 26 Apr 2007 15:54:49 +1000
> Seems the Linus has fixed this problem for us :-)
Yep :-)
> If you and Paul can get your for-2.6.22 trees pulled by Linus, I can
> submit the remaining patches to Linus (with your and Paul's blessing, of
> course).
For sure, I'll be pushing my tree soon.
^ permalink raw reply [flat|nested] 109+ messages in thread
* [PATCH] [POWERPC] Rename get_property to of_get_property: partial drivers
2007-04-03 12:42 ` [PATCH 11/17] [POWERPC] Rename get_property to of_get_property: drivers/char Stephen Rothwell
2007-04-03 12:43 ` [PATCH 12/17] [POWERPC] Rename get_property to of_get_property: drivers/net Stephen Rothwell
@ 2007-04-27 3:41 ` Stephen Rothwell
1 sibling, 0 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-27 3:41 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
This does dirvers/machintosh and the hvc code.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/char/hvc_iseries.c | 2 +-
drivers/char/hvc_vio.c | 2 +-
drivers/char/hvsi.c | 4 ++--
drivers/macintosh/macio_asic.c | 2 +-
drivers/macintosh/macio_sysfs.c | 4 ++--
drivers/macintosh/rack-meter.c | 2 +-
drivers/macintosh/smu.c | 6 +++---
drivers/macintosh/therm_adt746x.c | 8 ++++----
drivers/macintosh/therm_pm72.c | 8 ++++----
drivers/macintosh/therm_windtunnel.c | 2 +-
drivers/macintosh/via-cuda.c | 2 +-
drivers/macintosh/via-pmu-led.c | 2 +-
drivers/macintosh/via-pmu.c | 6 +++---
drivers/macintosh/windfarm_lm75_sensor.c | 2 +-
drivers/macintosh/windfarm_max6690_sensor.c | 2 +-
drivers/macintosh/windfarm_smu_controls.c | 8 ++++----
drivers/macintosh/windfarm_smu_sat.c | 8 ++++----
drivers/macintosh/windfarm_smu_sensors.c | 6 +++---
18 files changed, 38 insertions(+), 38 deletions(-)
Paul,
This is on top of your reversion of
d05c7a80cf39ae7d0f8d0c3e47c93d51fcd393d3.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index f144a94..ec420fe 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -575,7 +575,7 @@ static int hvc_find_vtys(void)
(num_found >= VTTY_PORTS))
break;
- vtermno = get_property(vty, "reg", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno)
continue;
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index f9c0084..94a542e 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -153,7 +153,7 @@ static int hvc_find_vtys(void)
if (num_found >= MAX_NR_HVC_CONSOLES)
break;
- vtermno = get_property(vty, "reg", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
if (!vtermno)
continue;
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 50315d6..d5a752d 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void)
struct hvsi_struct *hp;
const uint32_t *vtermno, *irq;
- vtermno = get_property(vty, "reg", NULL);
- irq = get_property(vty, "interrupts", NULL);
+ vtermno = of_get_property(vty, "reg", NULL);
+ irq = of_get_property(vty, "interrupts", NULL);
if (!vtermno || !irq)
continue;
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index e851266..c96b7fe 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -395,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
#endif
MAX_NODE_NAME_SIZE, np->name);
} else {
- reg = get_property(np, "reg", NULL);
+ reg = of_get_property(np, "reg", NULL);
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 0a5647f..cc82679 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
int length = 0;
of = &to_macio_device (dev)->ofdev;
- compat = get_property(of->node, "compatible", &cplen);
+ compat = of_get_property(of->node, "compatible", &cplen);
if (!compat) {
*buf = '\0';
return 0;
@@ -47,7 +47,7 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
int length;
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;
length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type);
buf += length;
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index f83fad2..4177ff0 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -387,7 +387,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
if (strcmp(np->name, "lightshow") == 0)
break;
if ((strcmp(np->name, "sound") == 0) &&
- get_property(np, "virtual", NULL) != NULL)
+ of_get_property(np, "virtual", NULL) != NULL)
break;
}
if (np == NULL) {
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 45bb3c1..135f22e 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -491,7 +491,7 @@ int __init smu_init (void)
printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
goto fail;
}
- data = get_property(smu->db_node, "reg", NULL);
+ data = of_get_property(smu->db_node, "reg", NULL);
if (data == NULL) {
of_node_put(smu->db_node);
smu->db_node = NULL;
@@ -512,7 +512,7 @@ int __init smu_init (void)
smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
if (smu->msg_node == NULL)
break;
- data = get_property(smu->msg_node, "reg", NULL);
+ data = of_get_property(smu->msg_node, "reg", NULL);
if (data == NULL) {
of_node_put(smu->msg_node);
smu->msg_node = NULL;
@@ -1004,7 +1004,7 @@ const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
} else
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) {
DPRINTK("trying to extract from SMU ...\n");
part = smu_create_sdb_partition(id);
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index a7ce559..2289034 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -567,13 +567,13 @@ thermostat_init(void)
else
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,
(*prop == 1)?"":"un");
if (*prop != 1)
return -ENODEV;
- prop = get_property(np, "reg", NULL);
+ prop = of_get_property(np, "reg", NULL);
if (!prop)
return -ENODEV;
@@ -591,9 +591,9 @@ thermostat_init(void)
"limit_adjust: %d, fan_speed: %d\n",
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++) {
- sensor_location[i] = get_property(np,
+ sensor_location[i] = of_get_property(np,
"hwsensor-location", NULL) + offset;
if (sensor_location[i] == NULL)
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 2e4ad44..78ff186 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -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");
return -ENODEV;
}
- data = get_property(np, "cpuid", &len);
+ data = of_get_property(np, "cpuid", &len);
if (data == NULL) {
printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n");
of_node_put(np);
@@ -1337,7 +1337,7 @@ static int init_backside_state(struct backside_pid_state *state)
*/
u3 = of_find_node_by_path("/u3@0,f8000000");
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) & 0x3f) < 0x34)
u3h = 0;
@@ -2129,8 +2129,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
continue;
/* Lookup for a matching location */
- loc = get_property(np, "location", NULL);
- reg = get_property(np, "reg", NULL);
+ loc = of_get_property(np, "location", NULL);
+ reg = of_get_property(np, "reg", NULL);
if (loc == NULL || reg == NULL)
continue;
DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg);
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index a1d3a98..35233de 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -492,7 +492,7 @@ g4fan_init( void )
if( !(np=of_find_node_by_name(NULL, "power-mgt")) )
return -ENODEV;
- info = get_property(np, "thermal-info", NULL);
+ info = of_get_property(np, "thermal-info", NULL);
of_node_put(np);
if( !info || !machine_is_compatible("PowerMac3,6") )
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index d58fcf6..76d2177 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -131,7 +131,7 @@ int __init find_via_cuda(void)
if (vias == 0)
return 0;
- reg = get_property(vias, "reg", NULL);
+ reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) {
printk(KERN_ERR "via-cuda: No \"reg\" property !\n");
goto fail;
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index f8d7a46..fc89a70 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -118,7 +118,7 @@ static int __init via_pmu_led_init(void)
dt = of_find_node_by_path("/");
if (dt == NULL)
return -ENODEV;
- model = get_property(dt, "model", NULL);
+ model = of_get_property(dt, "model", NULL);
if (model == NULL)
return -ENODEV;
if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 8470210..1729d3f 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -289,7 +289,7 @@ int __init find_via_pmu(void)
if (vias == NULL)
return 0;
- reg = get_property(vias, "reg", NULL);
+ reg = of_get_property(vias, "reg", NULL);
if (reg == NULL) {
printk(KERN_ERR "via-pmu: No \"reg\" property !\n");
goto fail;
@@ -334,7 +334,7 @@ int __init find_via_pmu(void)
gpiop = of_find_node_by_name(NULL, "gpio");
if (gpiop) {
- reg = get_property(gpiop, "reg", NULL);
+ reg = of_get_property(gpiop, "reg", NULL);
if (reg)
gaddr = of_translate_address(gpiop, reg);
if (gaddr != OF_BAD_ADDR)
@@ -491,7 +491,7 @@ static int __init via_pmu_dev_init(void)
of_find_node_by_name(NULL, "power-mgt");
const u32 *prim_info = NULL;
if (prim)
- prim_info = get_property(prim, "prim-info", NULL);
+ prim_info = of_get_property(prim, "prim-info", NULL);
if (prim_info) {
/* Other stuffs here yet unknown */
pmu_battery_count = (prim_info[6] >> 16) & 0xff;
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index 3f7967f..ab4d1b6 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -176,7 +176,7 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
for (dev = NULL;
(dev = of_get_next_child(busnode, dev)) != NULL;) {
const char *loc =
- get_property(dev, "hwsensor-location", NULL);
+ of_get_property(dev, "hwsensor-location", NULL);
u8 addr;
/* We must re-match the adapter in order to properly check
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c
index eae1189..eaa74af 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -134,7 +134,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
if (!device_is_compatible(dev, "max6690"))
continue;
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)
continue;
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 31b750d..ff398ad 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -167,7 +167,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
if (fct == NULL)
return NULL;
fct->ctrl.ops = &smu_fan_ops;
- l = get_property(node, "location", NULL);
+ l = of_get_property(node, "location", NULL);
if (l == NULL)
goto fail;
@@ -224,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
goto fail;
/* Get min & max values*/
- v = get_property(node, "min-value", NULL);
+ v = of_get_property(node, "min-value", NULL);
if (v == NULL)
goto fail;
fct->min = *v;
- v = get_property(node, "max-value", NULL);
+ v = of_get_property(node, "max-value", NULL);
if (v == NULL)
goto fail;
fct->max = *v;
/* Get "reg" value */
- reg = get_property(node, "reg", NULL);
+ reg = of_get_property(node, "reg", NULL);
if (reg == NULL)
goto fail;
fct->reg = *reg;
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index 83f79de..9a6c2cf 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -241,7 +241,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
char *name;
int vsens[2], isens[2];
- reg = get_property(dev, "reg", NULL);
+ reg = of_get_property(dev, "reg", NULL);
if (reg == NULL)
return;
addr = *reg;
@@ -268,9 +268,9 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
isens[0] = isens[1] = -1;
child = NULL;
while ((child = of_get_next_child(dev, child)) != NULL) {
- reg = get_property(child, "reg", NULL);
- type = get_property(child, "device_type", NULL);
- loc = get_property(child, "location", NULL);
+ reg = of_get_property(child, "reg", NULL);
+ type = of_get_property(child, "device_type", NULL);
+ loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL)
continue;
diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c
index 01b4c50..9c567b9 100644
--- a/drivers/macintosh/windfarm_smu_sensors.c
+++ b/drivers/macintosh/windfarm_smu_sensors.c
@@ -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);
if (ads == NULL)
return NULL;
- c = get_property(node, "device_type", NULL);
- l = get_property(node, "location", NULL);
+ c = of_get_property(node, "device_type", NULL);
+ l = of_get_property(node, "location", NULL);
if (c == NULL || l == NULL)
goto fail;
@@ -255,7 +255,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node)
} else
goto fail;
- v = get_property(node, "reg", NULL);
+ v = of_get_property(node, "reg", NULL);
if (v == NULL)
goto fail;
ads->reg = *v;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
* [PATCH] Partialially revert a7edd0e676d51145ae634a2acf7a447e319200fa
2007-04-03 0:52 [PATCH 1/6] [POWERPC] get_property returns const Stephen Rothwell
2007-04-03 0:54 ` [PATCH 2/6] [POWERPC] Rename get_property to of_get_property Stephen Rothwell
@ 2007-04-27 4:32 ` Stephen Rothwell
1 sibling, 0 replies; 109+ messages in thread
From: Stephen Rothwell @ 2007-04-27 4:32 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Due to conflicts with the network drivers tree.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/ehea/ehea_main.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d1a8134..0e4042b 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2320,7 +2320,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
struct net_device *dev = port->netdev;
struct ehea_adapter *adapter = port->adapter;
struct hcp_ehea_port_cb4 *cb4;
- const u32 *dn_log_port_id;
+ u32 *dn_log_port_id;
int jumbo = 0;
sema_init(&port->port_lock, 1);
@@ -2336,7 +2336,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
port->of_dev_node = dn;
/* Determine logical port id */
- dn_log_port_id = get_property(dn, "ibm,hea-port-no", NULL);
+ dn_log_port_id = (u32*)get_property(dn, "ibm,hea-port-no", NULL);
if (!dn_log_port_id) {
ehea_error("bad device node: dn_log_port_id=%p",
@@ -2492,7 +2492,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
const struct of_device_id *id)
{
struct ehea_adapter *adapter;
- const u64 *adapter_handle;
+ u64 *adapter_handle;
int ret;
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
@@ -2502,7 +2502,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
goto out;
}
- adapter_handle = get_property(dev->ofdev.node, "ibm,hea-handle",
+ adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
NULL);
if (adapter_handle)
adapter->handle = *adapter_handle;
--
1.5.1.2
^ permalink raw reply related [flat|nested] 109+ messages in thread
end of thread, other threads:[~2007-04-27 4:32 UTC | newest]
Thread overview: 109+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03 0:52 [PATCH 1/6] [POWERPC] get_property returns const Stephen Rothwell
2007-04-03 0:54 ` [PATCH 2/6] [POWERPC] Rename get_property to of_get_property Stephen Rothwell
2007-04-03 0:55 ` [PATCH 3/6] [POWERPC] Rename device_is_compatible to of_device_is_compatible Stephen Rothwell
2007-04-03 0:56 ` [PATCH 4/6] [POWERPC] Rename prom_n_addr_cells to of_n_addr_cells Stephen Rothwell
2007-04-03 0:57 ` [PATCH 5/6] [POWERPC] Rename prom_n_size_cells to of_n_size_cells Stephen Rothwell
2007-04-03 0:58 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Stephen Rothwell
2007-04-03 3:37 ` David Miller
2007-04-03 15:40 ` Segher Boessenkool
2007-04-03 12:24 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Stephen Rothwell
2007-04-03 12:26 ` [PATCH 02/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/kernel Stephen Rothwell
2007-04-03 12:28 ` [PATCH 03/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/mm Stephen Rothwell
2007-04-03 12:30 ` [PATCH 04/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/sysdev Stephen Rothwell
2007-04-03 12:31 ` [PATCH 05/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/pseries Stephen Rothwell
2007-04-03 12:32 ` [PATCH 06/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/powermac Stephen Rothwell
2007-04-03 12:35 ` [PATCH 07/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms/cell Stephen Rothwell
2007-04-03 12:37 ` [PATCH 08/17] [POWERPC] Rename get_property to of_get_property: arch/powerpc/platforms Stephen Rothwell
2007-04-03 12:39 ` [PATCH 09/17] [POWERPC] Rename get_property to of_get_property: sound Stephen Rothwell
2007-04-03 12:40 ` [PATCH 10/17] [POWERPC] Rename get_property to of_get_property: drivers/macintosh Stephen Rothwell
2007-04-03 12:42 ` [PATCH 11/17] [POWERPC] Rename get_property to of_get_property: drivers/char Stephen Rothwell
2007-04-03 12:43 ` [PATCH 12/17] [POWERPC] Rename get_property to of_get_property: drivers/net Stephen Rothwell
2007-04-03 12:45 ` [PATCH 13/17] [POWERPC] Rename get_property to of_get_property: drivers/video Stephen Rothwell
2007-04-03 12:46 ` [PATCH 14/17] [POWERPC] Rename get_property to of_get_property: drivers/scsi Stephen Rothwell
2007-04-03 12:49 ` [PATCH 15/17] [POWERPC] Rename get_property to of_get_property: drivers Stephen Rothwell
2007-04-03 12:50 ` [PATCH 16/17] [POWERPC] Rename get_property to of_get_property: the last one Stephen Rothwell
2007-04-03 12:52 ` [PATCH 17/17] [POWERPC] Remove get_property Stephen Rothwell
2007-04-03 13:05 ` [PATCH] [SPARC/64] " Stephen Rothwell
2007-04-03 13:24 ` [PATCH] [SPARC/64] Make device_node name and type const Stephen Rothwell
2007-04-12 4:19 ` [PATCH,RFC] Split out common parts of prom.h Stephen Rothwell
2007-04-12 4:25 ` David Miller
2007-04-12 16:13 ` Kumar Gala
2007-04-12 19:19 ` Segher Boessenkool
2007-04-12 5:34 ` [PATCH] Start split out of common open firmware code Stephen Rothwell
[not found] ` <20070424223245.78f4fdfb.sfr@canb.auug .org.au>
2007-04-12 5:41 ` David Miller
2007-04-12 5:50 ` Benjamin Herrenschmidt
2007-04-12 6:25 ` David Miller
2007-04-12 6:36 ` Benjamin Herrenschmidt
2007-04-12 6:40 ` David Miller
2007-04-12 7:00 ` Segher Boessenkool
2007-04-23 7:43 ` Stephen Rothwell
2007-04-23 18:30 ` Segher Boessenkool
2007-04-24 12:32 ` [PATCH 1/6] " Stephen Rothwell
2007-04-24 12:38 ` [PATCH 2/6] Consolidate of_device_is_compatible Stephen Rothwell
2007-04-24 13:36 ` Segher Boessenkool
2007-04-24 23:59 ` Benjamin Herrenschmidt
2007-04-25 4:23 ` David Miller
2007-04-24 12:39 ` [PATCH 3/6] Consolidate of_find_property Stephen Rothwell
2007-04-24 13:41 ` Segher Boessenkool
2007-04-25 1:43 ` Paul Mackerras
2007-04-25 2:10 ` Segher Boessenkool
2007-04-25 4:31 ` David Miller
2007-04-25 5:07 ` Benjamin Herrenschmidt
2007-04-25 13:13 ` Segher Boessenkool
2007-04-25 17:46 ` Matt Sealey
2007-04-25 19:02 ` Segher Boessenkool
2007-04-25 22:16 ` Benjamin Herrenschmidt
2007-04-25 22:24 ` David Miller
2007-04-25 22:47 ` Benjamin Herrenschmidt
2007-04-25 23:13 ` David Miller
2007-04-25 23:18 ` Segher Boessenkool
2007-04-25 23:28 ` David Miller
2007-04-25 23:21 ` Benjamin Herrenschmidt
2007-04-26 5:54 ` Stephen Rothwell
2007-04-26 5:58 ` David Miller
2007-04-25 0:00 ` Benjamin Herrenschmidt
2007-04-25 0:43 ` Segher Boessenkool
2007-04-25 1:12 ` Benjamin Herrenschmidt
2007-04-25 2:03 ` Segher Boessenkool
2007-04-25 4:24 ` David Miller
2007-04-24 12:40 ` [PATCH 4/6] Consolidate of_get_parent Stephen Rothwell
2007-04-24 14:42 ` Loeliger Jon-LOELIGER
2007-04-26 1:34 ` Stephen Rothwell
2007-04-24 12:42 ` [PATCH 5/6] Consolidate of_get_next_child Stephen Rothwell
2007-04-24 12:43 ` [PATCH 6/6] Consolidate of_find_node_by routines Stephen Rothwell
2007-04-25 0:01 ` Benjamin Herrenschmidt
2007-04-24 13:27 ` [PATCH 1/6] Start split out of common open firmware code Segher Boessenkool
2007-04-24 14:47 ` Loeliger Jon-LOELIGER
2007-04-24 18:04 ` David Miller
2007-04-24 18:18 ` Segher Boessenkool
2007-04-24 19:14 ` Jon Loeliger
2007-04-25 0:07 ` Benjamin Herrenschmidt
2007-04-25 1:03 ` Segher Boessenkool
2007-04-25 4:29 ` David Miller
2007-04-25 13:11 ` Segher Boessenkool
2007-04-25 0:03 ` Benjamin Herrenschmidt
2007-04-25 0:50 ` Segher Boessenkool
2007-04-25 1:51 ` Josh Boyer
2007-04-25 2:07 ` Segher Boessenkool
2007-04-25 4:27 ` David Miller
2007-04-25 13:07 ` Segher Boessenkool
2007-04-24 23:35 ` David Miller
2007-04-12 6:58 ` [PATCH,RFC] Split out common parts of prom.h Segher Boessenkool
2007-04-12 21:41 ` [PATCH] [SPARC/64] Make device_node name and type const David Miller
2007-04-12 21:42 ` [PATCH] [SPARC/64] Remove get_property David Miller
2007-04-27 3:41 ` [PATCH] [POWERPC] Rename get_property to of_get_property: partial drivers Stephen Rothwell
2007-04-03 17:36 ` [PATCH 01/17] [POWERPC] Rename get_property to of_get_property: include Olof Johansson
2007-04-05 1:49 ` Benjamin Herrenschmidt
2007-04-03 15:39 ` [PATCH 6/6] [POWERPC] make struct property's value a void * Segher Boessenkool
2007-04-03 18:28 ` David Miller
2007-04-04 11:11 ` Segher Boessenkool
2007-04-04 19:21 ` David Miller
2007-04-05 1:48 ` Benjamin Herrenschmidt
2007-04-05 18:12 ` Segher Boessenkool
2007-04-05 23:01 ` Benjamin Herrenschmidt
2007-04-05 23:12 ` David Miller
2007-04-05 23:26 ` Segher Boessenkool
2007-04-09 18:20 ` Paul Mackerras
2007-04-09 22:11 ` Segher Boessenkool
2007-04-09 23:17 ` David Miller
2007-04-27 4:32 ` [PATCH] Partialially revert a7edd0e676d51145ae634a2acf7a447e319200fa Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).