[PATCH 00/11] use of_property_read_bool

STALE3216d

6 messages, 2 authors, 2016-08-05 · open the first message on its own page

[PATCH 00/11] use of_property_read_bool

From: Julia Lawall <hidden>
Date: 2016-08-05 09:14:57

Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
statement S2,S1;
@@
-       if (of_get_property(e1,e2,NULL))
+       if (of_property_read_bool(e1,e2))
        S1 else S2
// </smpl>

---

 arch/powerpc/sysdev/mpic.c                  |    2 +-
 drivers/i2c/busses/i2c-mpc.c                |    2 +-
 drivers/mmc/host/sdhci-of-esdhc.c           |    2 +-
 drivers/net/ethernet/freescale/xgmac_mdio.c |    3 +--
 drivers/phy/phy-qcom-ufs.c                  |    2 +-
 drivers/pinctrl/nomadik/pinctrl-nomadik.c   |    2 +-
 drivers/soc/fsl/qe/qe_tdm.c                 |    2 +-
 drivers/soc/ti/knav_qmss_queue.c            |    2 +-
 drivers/tty/serial/atmel_serial.c           |    8 ++++----
 drivers/usb/host/fsl-mph-dr-of.c            |    6 +++---
 sound/soc/codecs/ab8500-codec.c             |   10 +++++-----
 sound/soc/sh/rcar/ssi.c                     |    2 +-
 sound/soc/soc-core.c                        |    2 +-
 13 files changed, 22 insertions(+), 23 deletions(-)

[PATCH 08/11] net/fsl: use of_property_read_bool

From: Julia Lawall <hidden>
Date: 2016-08-05 09:16:20

Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
statement S2,S1;
@@
-       if (of_get_property(e1,e2,NULL))
+       if (of_property_read_bool(e1,e2))
        S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/net/ethernet/freescale/xgmac_mdio.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 7b8fe86..a77ba98 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -271,8 +271,7 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 		goto err_ioremap;
 	}
 
-	if (of_get_property(pdev->dev.of_node,
-			    "little-endian", NULL))
+	if (of_property_read_bool(pdev->dev.of_node, "little-endian"))
 		priv->is_little_endian = true;
 	else
 		priv->is_little_endian = false;

[PATCH 08/11 v2] net/fsl: use of_property_read_bool

From: Julia Lawall <hidden>
Date: 2016-08-05 11:24:21

Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,x;
@@
-	if (of_get_property(e1,e2,NULL))
-		x = true;
-	else
-		x = false;
+	x = of_property_read_bool(e1,e2);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
v2: special case for propagating true and false

 drivers/net/ethernet/freescale/xgmac_mdio.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 7b8fe86..e03b30c 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -271,11 +271,8 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 		goto err_ioremap;
 	}

-	if (of_get_property(pdev->dev.of_node,
-			    "little-endian", NULL))
-		priv->is_little_endian = true;
-	else
-		priv->is_little_endian = false;
+	priv->is_little_endian = of_property_read_bool(pdev->dev.of_node,
+						       "little-endian");

 	ret = of_mdiobus_register(bus, np);
 	if (ret) {

Re: [PATCH 08/11] net/fsl: use of_property_read_bool

From: Sergei Shtylyov <hidden>
Date: 2016-08-05 11:35:32

Hello.

On 8/5/2016 11:56 AM, Julia Lawall wrote:
quoted hunk
Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
statement S2,S1;
@@
-       if (of_get_property(e1,e2,NULL))
+       if (of_property_read_bool(e1,e2))
        S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/net/ethernet/freescale/xgmac_mdio.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 7b8fe86..a77ba98 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -271,8 +271,7 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 		goto err_ioremap;
 	}

-	if (of_get_property(pdev->dev.of_node,
-			    "little-endian", NULL))
+	if (of_property_read_bool(pdev->dev.of_node, "little-endian"))
 		priv->is_little_endian = true;
 	else
 		priv->is_little_endian = false;
    priv->is_little_endian = of_property_read_bool(pdev->dev.of_node,
						  "little-endian"));

MBR, Sergei

Re: [PATCH 08/11] net/fsl: use of_property_read_bool

From: Julia Lawall <hidden>
Date: 2016-08-05 11:38:32


On Fri, 5 Aug 2016, Sergei Shtylyov wrote:
Hello.

On 8/5/2016 11:56 AM, Julia Lawall wrote:
quoted
Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
statement S2,S1;
@@
-       if (of_get_property(e1,e2,NULL))
+       if (of_property_read_bool(e1,e2))
        S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/net/ethernet/freescale/xgmac_mdio.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c
b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 7b8fe86..a77ba98 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -271,8 +271,7 @@ static int xgmac_mdio_probe(struct platform_device
*pdev)
 		goto err_ioremap;
 	}

-	if (of_get_property(pdev->dev.of_node,
-			    "little-endian", NULL))
+	if (of_property_read_bool(pdev->dev.of_node, "little-endian"))
 		priv->is_little_endian = true;
 	else
 		priv->is_little_endian = false;
   priv->is_little_endian = of_property_read_bool(pdev->dev.of_node,
						  "little-endian"));
Thanks,

I just sent a v2 with this change.

julia

Re: [PATCH 08/11] net/fsl: use of_property_read_bool

From: Sergei Shtylyov <hidden>
Date: 2016-08-05 11:40:59

On 8/5/2016 2:38 PM, Julia Lawall wrote:
quoted
quoted
Use of_property_read_bool to check for the existence of a property.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
statement S2,S1;
@@
-       if (of_get_property(e1,e2,NULL))
+       if (of_property_read_bool(e1,e2))
        S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/net/ethernet/freescale/xgmac_mdio.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c
b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 7b8fe86..a77ba98 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -271,8 +271,7 @@ static int xgmac_mdio_probe(struct platform_device
*pdev)
 		goto err_ioremap;
 	}

-	if (of_get_property(pdev->dev.of_node,
-			    "little-endian", NULL))
+	if (of_property_read_bool(pdev->dev.of_node, "little-endian"))
 		priv->is_little_endian = true;
 	else
 		priv->is_little_endian = false;
   priv->is_little_endian = of_property_read_bool(pdev->dev.of_node,
						  "little-endian"));
Thanks,

I just sent a v2 with this change.
    I've seen. Sorry, forgot to look at the followups before commenting...
julia
MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help