public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RESEND PATCH v2 1/7] gpio: pca953x_gpio: Fix style violations
@ 2018-01-15 10:07 Mario Six
  2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 2/7] gpio: pca953x_gpio: Make live-tree compatible Mario Six
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Mario Six @ 2018-01-15 10:07 UTC (permalink / raw)
  To: u-boot

Fix some style violations in the pca953x_gpio driver.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---

v1 -> v2:
None

---
 drivers/gpio/pca953x_gpio.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c
index 791d1d1516..5ea1e05eed 100644
--- a/drivers/gpio/pca953x_gpio.c
+++ b/drivers/gpio/pca953x_gpio.c
@@ -123,7 +123,8 @@ static int pca953x_read_regs(struct udevice *dev, int reg, u8 *val)
 		ret = dm_i2c_read(dev, reg << 1, val, info->bank_count);
 	} else if (info->gpio_count == 40) {
 		/* Auto increment */
-		ret = dm_i2c_read(dev, (reg << 3) | 0x80, val, info->bank_count);
+		ret = dm_i2c_read(dev, (reg << 3) | 0x80, val,
+				  info->bank_count);
 	} else {
 		dev_err(dev, "Unsupported now\n");
 		return -EINVAL;
@@ -143,7 +144,7 @@ static int pca953x_is_output(struct udevice *dev, int offset)
 	return !(info->reg_direction[bank] & (1 << off));
 }

-static int pca953x_get_value(struct udevice *dev, unsigned offset)
+static int pca953x_get_value(struct udevice *dev, uint offset)
 {
 	int ret;
 	u8 val = 0;
@@ -157,8 +158,7 @@ static int pca953x_get_value(struct udevice *dev, unsigned offset)
 	return (val >> off) & 0x1;
 }

-static int pca953x_set_value(struct udevice *dev, unsigned offset,
-			     int value)
+static int pca953x_set_value(struct udevice *dev, uint offset, int value)
 {
 	struct pca953x_info *info = dev_get_platdata(dev);
 	int bank = offset / BANK_SZ;
@@ -180,7 +180,7 @@ static int pca953x_set_value(struct udevice *dev, unsigned offset,
 	return 0;
 }

-static int pca953x_set_direction(struct udevice *dev, unsigned offset, int dir)
+static int pca953x_set_direction(struct udevice *dev, uint offset, int dir)
 {
 	struct pca953x_info *info = dev_get_platdata(dev);
 	int bank = offset / BANK_SZ;
@@ -202,13 +202,12 @@ static int pca953x_set_direction(struct udevice *dev, unsigned offset, int dir)
 	return 0;
 }

-static int pca953x_direction_input(struct udevice *dev, unsigned offset)
+static int pca953x_direction_input(struct udevice *dev, uint offset)
 {
 	return pca953x_set_direction(dev, offset, PCA953X_DIRECTION_IN);
 }

-static int pca953x_direction_output(struct udevice *dev, unsigned offset,
-				    int value)
+static int pca953x_direction_output(struct udevice *dev, uint offset, int value)
 {
 	/* Configure output value. */
 	pca953x_set_value(dev, offset, value);
@@ -219,7 +218,7 @@ static int pca953x_direction_output(struct udevice *dev, unsigned offset,
 	return 0;
 }

-static int pca953x_get_function(struct udevice *dev, unsigned offset)
+static int pca953x_get_function(struct udevice *dev, uint offset)
 {
 	if (pca953x_is_output(dev, offset))
 		return GPIOF_OUTPUT;
@@ -231,7 +230,7 @@ static int pca953x_xlate(struct udevice *dev, struct gpio_desc *desc,
 			 struct ofnode_phandle_args *args)
 {
 	desc->offset = args->args[0];
-	desc->flags = args->args[1] & GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0;
+	desc->flags = args->args[1] & (GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0);

 	return 0;
 }
--
2.11.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-01-28 18:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 10:07 [U-Boot] [RESEND PATCH v2 1/7] gpio: pca953x_gpio: Fix style violations Mario Six
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 2/7] gpio: pca953x_gpio: Make live-tree compatible Mario Six
2018-01-28 18:51   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 3/7] gpio: mpc85xx_gpio: Fix style violations Mario Six
2018-01-28 18:51   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 4/7] gpio: mpc85xx: Rename driver file to mpc8xxx Mario Six
2018-01-28 18:51   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 5/7] gpio: mpc8xxx: Rename Kconfig option, structures, and functions Mario Six
2018-01-28 18:52   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 6/7] gpio: mpc8xxx: Make compatible with more SoCs Mario Six
2018-01-28 18:52   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-15 10:07 ` [U-Boot] [RESEND PATCH v2 7/7] gpio: mpc8xxx: Make live-tree compatible Mario Six
2018-01-28 18:52   ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
2018-01-28 18:51 ` [U-Boot] [U-Boot, RESEND, v2, 1/7] gpio: pca953x_gpio: Fix style violations Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox