Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1456963 > unrolled thread

[PATCH 04/11] i2c: mpc: use of_property_read_bool

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-08-05 11:20 +0200
Last post2016-08-05 11:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 04/11] i2c: mpc: use of_property_read_bool Julia Lawall <Julia.Lawall@lip6.fr> - 2016-08-05 11:20 +0200

#1456963 — [PATCH 04/11] i2c: mpc: use of_property_read_bool

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-08-05 11:20 +0200
Subject[PATCH 04/11] i2c: mpc: use of_property_read_bool
Message-ID<s2Jsl-5yi-9@gated-at.bofh.it>
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 <Julia.Lawall@lip6.fr>

---
 drivers/i2c/busses/i2c-mpc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 48ecffe..4b5707b 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -700,7 +700,7 @@ static int fsl_i2c_probe(struct platform_device *op)
 		}
 	}
 
-	if (of_get_property(op->dev.of_node, "fsl,preserve-clocking", NULL)) {
+	if (of_property_read_bool(op->dev.of_node, "fsl,preserve-clocking")) {
 		clock = MPC_I2C_CLOCK_PRESERVE;
 	} else {
 		prop = of_get_property(op->dev.of_node, "clock-frequency",

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web