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

- Subsystems: FREESCALE QUICC ENGINE LIBRARY, FREESCALE SOC DRIVERS, LINUX FOR POWERPC (32-BIT AND 64-BIT), ARM/NOMADIK/Ux500 ARCHITECTURES, FREESCALE MPC I2C DRIVER, GENERIC PHY FRAMEWORK, I2C SUBSYSTEM, I2C SUBSYSTEM HOST DRIVERS, MICROCHIP AT91 SERIAL DRIVER, MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM, NETWORKING DRIVERS, 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: Qiang Zhao, Christophe Leroy, Madhavan Srinivasan, Linus Walleij, Chris Packham, Vinod Koul, Andi Shyti, Richard Genoud, Ulf Hansson, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, 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: linuxppc-dev
- 4 messages, 2 authors
- Page: https://ratatoskr.run/linuxppc-dev/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/linuxppc-dev/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 01/11\] fsl/qe: use of\_property\_read\_bool

- From: Julia Lawall \<hidden\>
- Date: 2016-08-05 09:15:00 
- Message: https://ratatoskr.run/linuxppc-dev/2016/08/4808645.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/soc/fsl/qe/qe_tdm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c
index 5e48b14..0ac98e6 100644
--- a/drivers/soc/fsl/qe/qe_tdm.c
+++ b/drivers/soc/fsl/qe/qe_tdm.c
@@ -99,7 +99,7 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm,
 	utdm->tdm_port = val;
 	ut_info->uf_info.tdm_num = utdm->tdm_port;
 
-	if (of_get_property(np, "fsl,tdm-internal-loopback", NULL))
+	if (of_property_read_bool(np, "fsl,tdm-internal-loopback"))
 		utdm->tdm_mode = TDM_INTERNAL_LOOPBACK;
 	else
 		utdm->tdm_mode = TDM_NORMAL;
```

## \[PATCH 09/11\] powerpc/mpic: use of\_property\_read\_bool

- From: Julia Lawall \<hidden\>
- Date: 2016-08-05 09:15:39 
- Message: https://ratatoskr.run/linuxppc-dev/2016/08/4808648.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>

---
 arch/powerpc/sysdev/mpic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 7de45b2..26d9c3f 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1249,7 +1249,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 	/* Pick the physical address from the device tree if unspecified */
 	if (!phys_addr) {
 		/* Check if it is DCR-based */
-		if (of_get_property(node, "dcr-reg", NULL)) {
+		if (of_property_read_bool(node, "dcr-reg")) {
 			flags |= MPIC_USES_DCR;
 		} else {
 			struct resource r;
```

## Re: \[PATCH 09/11\] powerpc/mpic: use of\_property\_read\_bool

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2016-08-08 06:47:20 
- Message: https://ratatoskr.run/linuxppc-dev/2016/08/4809293.md

```text
Julia Lawall [ref] writes:

> 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>
>
> ---
>  arch/powerpc/sysdev/mpic.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers
```
