# \[PATCH 00/11\] use of\_property\_read\_bool

- Subsystems: NETWORKING DRIVERS, ARM/NOMADIK/Ux500 ARCHITECTURES, FREESCALE MPC I2C DRIVER, FREESCALE QUICC ENGINE LIBRARY, FREESCALE SOC DRIVERS, GENERIC PHY FRAMEWORK, I2C SUBSYSTEM, I2C SUBSYSTEM HOST DRIVERS, LINUX FOR POWERPC (32-BIT AND 64-BIT), MICROCHIP AT91 SERIAL DRIVER, MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM, PIN CONTROL SUBSYSTEM, SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER, SOUND, SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC), THE REST, TI KEYSTONE MULTICORE NAVIGATOR DRIVERS, TTY LAYER AND SERIAL DRIVERS, USB SUBSYSTEM
- Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Walleij, Chris Packham, Qiang Zhao, Christophe Leroy, Vinod Koul, Andi Shyti, Madhavan Srinivasan, Richard Genoud, Ulf Hansson, Adrian Hunter, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Linus Torvalds, Nishanth Menon, Santosh Shilimkar, Greg Kroah-Hartman, Jiri Slaby
- Series: 11 patches touching 13 files, +22/-23
- List: netdev
- 6 messages, 2 authors
- Page: https://ratatoskr.run/netdev/2016/08/4808654/t

## \[PATCH 00/11\] use of\_property\_read\_bool

- From: Julia Lawall \<hidden\>
- Date: 2016-08-05 09:14:57 
- Message: https://ratatoskr.run/netdev/2016/08/4808654.md

```text
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 
- Message: https://ratatoskr.run/netdev/2016/08/4808650.md

```text
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 
- Message: https://ratatoskr.run/netdev/2016/08/4808718.md

```text
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 
- Message: https://ratatoskr.run/netdev/2016/08/4808722.md

```text
Hello.

On 8/5/2016 11:56 AM, Julia Lawall wrote:

> 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 
- Message: https://ratatoskr.run/netdev/2016/08/4808724.md

```text


On Fri, 5 Aug 2016, Sergei Shtylyov wrote:

> Hello.
>
> On 8/5/2016 11:56 AM, Julia Lawall wrote:
>
> > 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 
- Message: https://ratatoskr.run/netdev/2016/08/4808725.md

```text
On 8/5/2016 2:38 PM, Julia Lawall wrote:

>>> 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
```
