use of_property_read_bool() for testing bool property
Unified · Split
| @@ -738,7 +738,6 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) · 737 unmodified lines | ||
| 738 | 738 | struct gfar_private *priv = NULL; |
| 739 | 739 | struct device_node *np = ofdev->dev.of_node; |
| 740 | 740 | struct device_node *child = NULL; |
| 741 | − struct property *stash; | |
| 742 | 741 | u32 stash_len = 0; |
| 743 | 742 | u32 stash_idx = 0; |
| 744 | 743 | 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) · 109 unmodified lines | ||
| 854 | 853 | goto err_grp_init; |
| 855 | 854 | } |
| 856 | 855 | |
| 857 | − stash = of_find_property(np, "bd-stash", NULL); | |
| 858 | − | |
| 859 | − if (stash) { | |
| 856 | + if (of_property_read_bool(np, "bd-stash")) { | |
| 860 | 857 | priv->device_flags |= FSL_GIANFAR_DEV_HAS_BD_STASHING; |
| 861 | 858 | priv->bd_stash_en = 1; |
| 862 | 859 | } |