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

Commit 8efca493 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Paul Mackerras
Browse files

[POWERPC] mpc: Constify & voidify get_property()



Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

mpc* platform changes.

Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent c4c7cba9
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -80,8 +80,8 @@ static void __init mpc834x_itx_setup_arch(void)


	np = of_find_node_by_type(NULL, "cpu");
	np = of_find_node_by_type(NULL, "cpu");
	if (np != 0) {
	if (np != 0) {
		unsigned int *fp =
		const unsigned int *fp =
		    (int *)get_property(np, "clock-frequency", NULL);
			get_property(np, "clock-frequency", NULL);
		if (fp != 0)
		if (fp != 0)
			loops_per_jiffy = *fp / HZ;
			loops_per_jiffy = *fp / HZ;
		else
		else
+2 −2
Original line number Original line Diff line number Diff line
@@ -84,8 +84,8 @@ static void __init mpc834x_sys_setup_arch(void)


	np = of_find_node_by_type(NULL, "cpu");
	np = of_find_node_by_type(NULL, "cpu");
	if (np != 0) {
	if (np != 0) {
		unsigned int *fp =
		const unsigned int *fp =
		    (int *)get_property(np, "clock-frequency", NULL);
			get_property(np, "clock-frequency", NULL);
		if (fp != 0)
		if (fp != 0)
			loops_per_jiffy = *fp / HZ;
			loops_per_jiffy = *fp / HZ;
		else
		else
+2 −2
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ int __init add_bridge(struct device_node *dev)
	int len;
	int len;
	struct pci_controller *hose;
	struct pci_controller *hose;
	struct resource rsrc;
	struct resource rsrc;
	int *bus_range;
	const int *bus_range;
	int primary = 1, has_address = 0;
	int primary = 1, has_address = 0;
	phys_addr_t immr = get_immrbase();
	phys_addr_t immr = get_immrbase();


@@ -60,7 +60,7 @@ int __init add_bridge(struct device_node *dev)
	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);


	/* Get bus range if any */
	/* Get bus range if any */
	bus_range = (int *)get_property(dev, "bus-range", &len);
	bus_range = get_property(dev, "bus-range", &len);
	if (bus_range == NULL || len < 2 * sizeof(int)) {
	if (bus_range == NULL || len < 2 * sizeof(int)) {
		printk(KERN_WARNING "Can't get bus-range for %s, assume"
		printk(KERN_WARNING "Can't get bus-range for %s, assume"
		       " bus 0\n", dev->full_name);
		       " bus 0\n", dev->full_name);
+2 −2
Original line number Original line Diff line number Diff line
@@ -172,9 +172,9 @@ static void __init mpc85xx_ads_setup_arch(void)


	cpu = of_find_node_by_type(NULL, "cpu");
	cpu = of_find_node_by_type(NULL, "cpu");
	if (cpu != 0) {
	if (cpu != 0) {
		unsigned int *fp;
		const unsigned int *fp;


		fp = (int *)get_property(cpu, "clock-frequency", NULL);
		fp = get_property(cpu, "clock-frequency", NULL);
		if (fp != 0)
		if (fp != 0)
			loops_per_jiffy = *fp / HZ;
			loops_per_jiffy = *fp / HZ;
		else
		else
+2 −2
Original line number Original line Diff line number Diff line
@@ -273,9 +273,9 @@ mpc85xx_cds_setup_arch(void)


	cpu = of_find_node_by_type(NULL, "cpu");
	cpu = of_find_node_by_type(NULL, "cpu");
	if (cpu != 0) {
	if (cpu != 0) {
		unsigned int *fp;
		const unsigned int *fp;


		fp = (int *)get_property(cpu, "clock-frequency", NULL);
		fp = get_property(cpu, "clock-frequency", NULL);
		if (fp != 0)
		if (fp != 0)
			loops_per_jiffy = *fp / HZ;
			loops_per_jiffy = *fp / HZ;
		else
		else
Loading