Skip to contentSkip to conversation

gianfar: use of_property_read_bool()

PATCH Applied Saurabh Sengar 2 participants 2 messages Nov 20, 2015 – Nov 23, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gianfar: use of_property_read_bool()

use of_property_read_bool() for testing bool property

---
 drivers/net/ethernet/freescale/gianfar.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/freescale/gianfar.c +1 -4
index 3e6b9b4..ebeea5e 100644
@@ -738,7 +738,6 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 	struct gfar_private *priv = NULL;
 	struct device_node *np = ofdev->dev.of_node;
 	struct device_node *child = NULL;
-	struct property *stash;
 	u32 stash_len = 0;
 	u32 stash_idx = 0;
 	unsigned int num_tx_qs, num_rx_qs;
@@ -854,9 +853,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 			goto err_grp_init;
 	}
 
-	stash = of_find_property(np, "bd-stash", NULL);
-
-	if (stash) {
+	if (of_property_read_bool(np, "bd-stash")) {
 		priv->device_flags |= FSL_GIANFAR_DEV_HAS_BD_STASHING;
 		priv->bd_stash_en = 1;
 	}
Signature · 1 line
1.9.1