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 | struct gfar_private *priv = NULL; | 738 | struct gfar_private *priv = NULL; |
| 739 | struct device_node *np = ofdev->dev.of_node; | 739 | struct device_node *np = ofdev->dev.of_node; |
| 740 | struct device_node *child = NULL; | 740 | struct device_node *child = NULL; |
| 741 | struct property *stash; | ||
| 742 | u32 stash_len = 0; | 741 | u32 stash_len = 0; |
| 743 | u32 stash_idx = 0; | 742 | u32 stash_idx = 0; |
| 744 | unsigned int num_tx_qs, num_rx_qs; | 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 | goto err_grp_init; | 853 | goto err_grp_init; |
| 855 | } | 854 | } |
| 856 | 855 | ||
| 857 | stash = of_find_property(np, "bd-stash", NULL); | 856 | if (of_property_read_bool(np, "bd-stash")) { |
| 858 | |||
| 859 | if (stash) { | ||
| 860 | priv->device_flags |= FSL_GIANFAR_DEV_HAS_BD_STASHING; | 857 | priv->device_flags |= FSL_GIANFAR_DEV_HAS_BD_STASHING; |
| 861 | priv->bd_stash_en = 1; | 858 | priv->bd_stash_en = 1; |
| 862 | } | 859 | } |