[patch 1/2 -next] mdio: remove an unneed condition

Subsystems: open firmware and flattened device tree, the rest

STALE3875d

3 messages, 3 authors, 2016-01-12 · open the first message on its own page

[patch 1/2 -next] mdio: remove an unneed condition

From: Dan Carpenter <hidden>
Date: 2016-01-12 09:36:06

It used to be that mdio->irq was a pointer but after e7f4dc3536a4
('mdio: Move allocation of interrupts into core') it's an array inside
the mdio struct so it can never be NULL.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index c0a8f84..86829f8 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -62,11 +62,9 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
 	rc = irq_of_parse_and_map(child, 0);
 	if (rc > 0) {
 		phy->irq = rc;
-		if (mdio->irq)
-			mdio->irq[addr] = rc;
+		mdio->irq[addr] = rc;
 	} else {
-		if (mdio->irq)
-			phy->irq = mdio->irq[addr];
+		phy->irq = mdio->irq[addr];
 	}
 
 	if (of_property_read_bool(child, "broken-turn-around"))

Re: [patch 1/2 -next] mdio: remove an unneed condition

From: Andrew Lunn <andrew@lunn.ch>
Date: 2016-01-12 14:09:38

On Tue, Jan 12, 2016 at 12:35:34PM +0300, Dan Carpenter wrote:
It used to be that mdio->irq was a pointer but after e7f4dc3536a4
('mdio: Move allocation of interrupts into core') it's an array inside
the mdio struct so it can never be NULL.

Signed-off-by: Dan Carpenter <redacted>
For both patches:

Reviewd-by: Andrew Lunn [off-list ref]

Thanks
	Andrew
quoted hunk
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index c0a8f84..86829f8 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -62,11 +62,9 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
 	rc = irq_of_parse_and_map(child, 0);
 	if (rc > 0) {
 		phy->irq = rc;
-		if (mdio->irq)
-			mdio->irq[addr] = rc;
+		mdio->irq[addr] = rc;
 	} else {
-		if (mdio->irq)
-			phy->irq = mdio->irq[addr];
+		phy->irq = mdio->irq[addr];
 	}
 
 	if (of_property_read_bool(child, "broken-turn-around"))
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [patch 1/2 -next] mdio: remove an unneed condition

From: David Miller <davem@davemloft.net>
Date: 2016-01-12 19:30:59

From: Dan Carpenter <redacted>
Date: Tue, 12 Jan 2016 12:35:34 +0300
It used to be that mdio->irq was a pointer but after e7f4dc3536a4
('mdio: Move allocation of interrupts into core') it's an array inside
the mdio struct so it can never be NULL.

Signed-off-by: Dan Carpenter <redacted>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help