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

Commit e2eb6392 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras
Browse files

[POWERPC] Rename get_property to of_get_property: arch/powerpc

parent ceef8778
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -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);
+10 −12
Original line number Diff line number Diff line
@@ -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)) {
+12 −12
Original line number Diff line number Diff line
@@ -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;

+5 −4
Original line number Diff line number Diff line
@@ -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;
	}
+2 −2
Original line number Diff line number Diff line
@@ -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;

Loading