Skip to contentSkip to conversation

i2c: gpio: merge two very similar comments

PATCH Superseded Wolfram Sang 3 participants 4 messages Jan 19, 2019 – Jan 24, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wolfram Sang

author maintainer
#0 lore raw

PATCH 1/1 i2c: gpio: merge two very similar comments

I think it is clear enough if we have the explanation once and make it clear it is applicable for both SCL and SDA.

---
 drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/i2c/busses/i2c-gpio.c +4 -11
index c008d209f0b8..b9d43bc2853f 100644
@@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
 	/*
 	 * First get the GPIO pins; if it fails, we'll defer the probe.
-	 * If the SDA line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
+	 * If the SCL/SDA lines are marked from platform data or device tree
+	 * as "open drain" it means something outside of our control is making
+	 * these lines being handled as open drain, and we should just handle
+	 * them as any other output. Else we enforce open drain as this is
 	 * required for an I2C bus.
 	 */
 	if (pdata->sda_is_open_drain)
@@ -300,13 +300,6 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->sda))
 		return PTR_ERR(priv->sda);
 
-	/*
-	 * If the SCL line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
-	 * required for an I2C bus.
-	 */
 	if (pdata->scl_is_open_drain)
 		gflags = GPIOD_OUT_HIGH;
 	else
Signature · 1 line
2.11.0
#1 lore raw
Quoted 15 lines · Wolfram Sang

I think it is clear enough if we have the explanation once and make it clear it is applicable for both SCL and SDA.

---
 drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/i2c/busses/i2c-gpio.c +0 -0
index c008d209f0b8..b9d43bc2853f 100644
@@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
 	/*

drivers/i2c/busses/i2c-gpio.c static int i2c_gpio_probe(struct platform_device *pdev) · line 293

Quoted 10 lines
drivers/i2c/busses/i2c-gpio.c +4 -4
 	 * First get the GPIO pins; if it fails, we'll defer the probe.
-	 * If the SDA line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
+	 * If the SCL/SDA lines are marked from platform data or device tree
+	 * as "open drain" it means something outside of our control is making
+	 * these lines being handled as open drain, and we should just handle
+	 * them as any other output. Else we enforce open drain as this is
 	 * required for an I2C bus.

<2c>
If the SCL/SDA lines are marked "open drain" by platform data or device tree then this means that something outside of our control is marking these lines to be handled as open drain, and we should just handle them as we handle any other output. Else we enforce open drain as this is required for an I2C bus.
</2c>

Quoted 19 lines
drivers/i2c/busses/i2c-gpio.c +0 -7
 	 */
 	if (pdata->sda_is_open_drain)
@@ -300,13 +300,6 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->sda))
 		return PTR_ERR(priv->sda);
 
-	/*
-	 * If the SCL line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
-	 * required for an I2C bus.
-	 */
 	if (pdata->scl_is_open_drain)
 		gflags = GPIOD_OUT_HIGH;
 	else
Signature · 1 line
2.11.0
#2 lore raw
Quoted 27 lines · Simon Horman
Quoted 15 lines · Wolfram Sang

I think it is clear enough if we have the explanation once and make it clear it is applicable for both SCL and SDA.

---
 drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/i2c/busses/i2c-gpio.c +0 -0
index c008d209f0b8..b9d43bc2853f 100644
@@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
 	/*

drivers/i2c/busses/i2c-gpio.c static int i2c_gpio_probe(struct platform_device *pdev) · line 293

Quoted 10 lines
drivers/i2c/busses/i2c-gpio.c +4 -4
 	 * First get the GPIO pins; if it fails, we'll defer the probe.
-	 * If the SDA line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
+	 * If the SCL/SDA lines are marked from platform data or device tree
+	 * as "open drain" it means something outside of our control is making
+	 * these lines being handled as open drain, and we should just handle
+	 * them as any other output. Else we enforce open drain as this is
 	 * required for an I2C bus.
Quoted 7 lines

<2c>
If the SCL/SDA lines are marked "open drain" by platform data or device tree then this means that something outside of our control is marking these lines to be handled as open drain, and we should just handle them as we handle any other output. Else we enforce open drain as this is required for an I2C bus.
</2c>

Cool, thanks Simon. Should I add your SoB when sending V2?

#3 lore raw
Quoted 36 lines · Wolfram Sang
Quoted 27 lines · Simon Horman
Quoted 15 lines · Wolfram Sang

I think it is clear enough if we have the explanation once and make it clear it is applicable for both SCL and SDA.

---
 drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/i2c/busses/i2c-gpio.c +0 -0
index c008d209f0b8..b9d43bc2853f 100644
@@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
 	/*

drivers/i2c/busses/i2c-gpio.c static int i2c_gpio_probe(struct platform_device *pdev) · line 293

Quoted 10 lines
drivers/i2c/busses/i2c-gpio.c +4 -4
 	 * First get the GPIO pins; if it fails, we'll defer the probe.
-	 * If the SDA line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
+	 * If the SCL/SDA lines are marked from platform data or device tree
+	 * as "open drain" it means something outside of our control is making
+	 * these lines being handled as open drain, and we should just handle
+	 * them as any other output. Else we enforce open drain as this is
 	 * required for an I2C bus.
Quoted 7 lines

<2c>
If the SCL/SDA lines are marked "open drain" by platform data or device tree then this means that something outside of our control is marking these lines to be handled as open drain, and we should just handle them as we handle any other output. Else we enforce open drain as this is required for an I2C bus.
</2c>

Quoted 1 line

Cool, thanks Simon. Should I add your SoB when sending V2?

Sure,