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

Commit 20a9da34 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sparc-OF-name-and-device_type-rework'



Rob Herring says:

====================
sparc: OF name and device_type rework

All other platforms have been converted to only store the local node name
in device_node.full_name except Sparc. Sparc was complicated by having a
path_component_name in addition to full_name and name. By switching
full_name to just the local node name, path_component_name becomes
redundant and can be removed.

The rest of the series converts the sparc code to use printf specifiers
and helper functions to access node name and device_type instead of
directly accessing device_node full_name, name and type pointers.

I've tested this series under qemu.

v2:
- Add patch using of_node_name_eq for openpromfs
- Add patch converting some resource names to full_name
- Also drop full path on !Sparc PDT node name construction
- Add a few missed %pOFn conversions
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 25e19c1f 86ef771e
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -528,9 +528,9 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive)


static int __init ebus_fdthree_p(struct device_node *dp)
static int __init ebus_fdthree_p(struct device_node *dp)
{
{
	if (!strcmp(dp->name, "fdthree"))
	if (of_node_name_eq(dp, "fdthree"))
		return 1;
		return 1;
	if (!strcmp(dp->name, "floppy")) {
	if (of_node_name_eq(dp, "floppy")) {
		const char *compat;
		const char *compat;


		compat = of_get_property(dp, "compatible", NULL);
		compat = of_get_property(dp, "compatible", NULL);
@@ -555,7 +555,7 @@ static unsigned long __init sun_floppy_init(void)
	op = NULL;
	op = NULL;


	for_each_node_by_name(dp, "SUNW,fdtwo") {
	for_each_node_by_name(dp, "SUNW,fdtwo") {
		if (strcmp(dp->parent->name, "sbus"))
		if (!of_node_name_eq(dp->parent, "sbus"))
			continue;
			continue;
		op = of_find_device_by_node(dp);
		op = of_find_device_by_node(dp);
		if (op)
		if (op)
@@ -656,7 +656,7 @@ static unsigned long __init sun_floppy_init(void)
		 */
		 */
		config = 0;
		config = 0;
		for (dp = ebus_dp->child; dp; dp = dp->sibling) {
		for (dp = ebus_dp->child; dp; dp = dp->sibling) {
			if (!strcmp(dp->name, "ecpp")) {
			if (of_node_name_eq(dp, "ecpp")) {
				struct platform_device *ecpp_op;
				struct platform_device *ecpp_op;


				ecpp_op = of_find_device_by_node(dp);
				ecpp_op = of_find_device_by_node(dp);
+0 −1
Original line number Original line Diff line number Diff line
@@ -225,7 +225,6 @@ void leon_update_virq_handling(unsigned int virq,
			       irq_flow_handler_t flow_handler,
			       irq_flow_handler_t flow_handler,
			       const char *name, int do_ack);
			       const char *name, int do_ack);
void leon_init_timers(void);
void leon_init_timers(void);
void leon_trans_init(struct device_node *dp);
void leon_node_init(struct device_node *dp, struct device_node ***nextp);
void leon_node_init(struct device_node *dp, struct device_node ***nextp);
void init_leon(void);
void init_leon(void);
void poke_leonsparc(void);
void poke_leonsparc(void);
+1 −1
Original line number Original line Diff line number Diff line
@@ -117,7 +117,7 @@ static int ecpp_probe(struct platform_device *op)
	int slot, err;
	int slot, err;


	parent = op->dev.of_node->parent;
	parent = op->dev.of_node->parent;
	if (!strcmp(parent->name, "dma")) {
	if (of_node_name_eq(parent, "dma")) {
		p = parport_pc_probe_port(base, base + 0x400,
		p = parport_pc_probe_port(base, base + 0x400,
					  op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
					  op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
					  op->dev.parent->parent, 0);
					  op->dev.parent->parent, 0);
+5 −6
Original line number Original line Diff line number Diff line
@@ -108,23 +108,22 @@ static int auxio_probe(struct platform_device *dev)
	struct device_node *dp = dev->dev.of_node;
	struct device_node *dp = dev->dev.of_node;
	unsigned long size;
	unsigned long size;


	if (!strcmp(dp->parent->name, "ebus")) {
	if (of_node_name_eq(dp->parent, "ebus")) {
		auxio_devtype = AUXIO_TYPE_EBUS;
		auxio_devtype = AUXIO_TYPE_EBUS;
		size = sizeof(u32);
		size = sizeof(u32);
	} else if (!strcmp(dp->parent->name, "sbus")) {
	} else if (of_node_name_eq(dp->parent, "sbus")) {
		auxio_devtype = AUXIO_TYPE_SBUS;
		auxio_devtype = AUXIO_TYPE_SBUS;
		size = 1;
		size = 1;
	} else {
	} else {
		printk("auxio: Unknown parent bus type [%s]\n",
		printk("auxio: Unknown parent bus type [%pOFn]\n",
		       dp->parent->name);
		       dp->parent);
		return -ENODEV;
		return -ENODEV;
	}
	}
	auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
	auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
	if (!auxio_register)
	if (!auxio_register)
		return -ENODEV;
		return -ENODEV;


	printk(KERN_INFO "AUXIO: Found device at %s\n",
	printk(KERN_INFO "AUXIO: Found device at %pOF\n", dp);
	       dp->full_name);


	if (auxio_devtype == AUXIO_TYPE_EBUS)
	if (auxio_devtype == AUXIO_TYPE_EBUS)
		auxio_set_led(AUXIO_LED_ON);
		auxio_set_led(AUXIO_LED_ON);
+1 −1
Original line number Original line Diff line number Diff line
@@ -168,7 +168,7 @@ static int fhc_probe(struct platform_device *op)
		goto out;
		goto out;
	}
	}


	if (!strcmp(op->dev.of_node->parent->name, "central"))
	if (of_node_name_eq(op->dev.of_node->parent, "central"))
		p->central = true;
		p->central = true;


	p->pregs = of_ioremap(&op->resource[0], 0,
	p->pregs = of_ioremap(&op->resource[0], 0,
Loading