[PATCH v1 3/5] i2c: mux: pca954x: Drop useless validation for optional GPIO descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need to perform a check for optional GPIO descriptor.
If it's NULL, the API can handle it correctly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 2e42a113ef1f..fe4320fc0b91 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -444,12 +444,12 @@ static int pca954x_probe(struct i2c_client *client,
 	gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(gpio))
 		return PTR_ERR(gpio);
-	if (gpio) {
-		udelay(1);
-		gpiod_set_value_cansleep(gpio, 0);
-		/* Give the chip some time to recover. */
-		udelay(1);
-	}
+
+	/* Reset the multiplexer */
+	udelay(1);
+	gpiod_set_value_cansleep(gpio, 0);
+	/* Give the chip some time to recover. */
+	udelay(1);
 
 	data->chip = device_get_match_data(dev);
 	if (!data->chip)
-- 
2.25.1




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux