All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Six <mario.six@gdsys.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 063/080] gpio: mpc85xx_gpio: Fix style violations
Date: Fri, 29 Sep 2017 14:52:21 +0200	[thread overview]
Message-ID: <20170929125238.26226-63-mario.six@gdsys.cc> (raw)
In-Reply-To: <20170929125238.26226-1-mario.six@gdsys.cc>

Fix some style violations in the MPC85XX GPIO driver.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
 drivers/gpio/mpc85xx_gpio.c | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/drivers/gpio/mpc85xx_gpio.c b/drivers/gpio/mpc85xx_gpio.c
index cfeb6e7632..4566c091b7 100644
--- a/drivers/gpio/mpc85xx_gpio.c
+++ b/drivers/gpio/mpc85xx_gpio.c
@@ -34,11 +34,13 @@ struct mpc85xx_gpio_data {
 	uint gpio_count;
 	/* The GPDAT register cannot be used to determine the value of output
 	 * pins on MPC8572/MPC8536, so we shadow it and use the shadowed value
-	 * for output pins */
+	 * for output pins
+	 */
 	u32 dat_shadow;
 };
 
-inline u32 gpio_mask(unsigned gpio) {
+inline u32 gpio_mask(uint gpio)
+{
 	return (1U << (31 - (gpio)));
 }
 
@@ -92,7 +94,7 @@ static inline void mpc85xx_gpio_open_drain_off(struct ccsr_gpio *base,
 	clrbits_be32(&base->gpodr, gpios);
 }
 
-static int mpc85xx_gpio_direction_input(struct udevice *dev, unsigned gpio)
+static int mpc85xx_gpio_direction_input(struct udevice *dev, uint gpio)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 
@@ -100,8 +102,7 @@ static int mpc85xx_gpio_direction_input(struct udevice *dev, unsigned gpio)
 	return 0;
 }
 
-static int mpc85xx_gpio_set_value(struct udevice *dev, unsigned gpio,
-				  int value)
+static int mpc85xx_gpio_set_value(struct udevice *dev, uint gpio, int value)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 
@@ -115,46 +116,46 @@ static int mpc85xx_gpio_set_value(struct udevice *dev, unsigned gpio,
 	return 0;
 }
 
-static int mpc85xx_gpio_direction_output(struct udevice *dev, unsigned gpio,
+static int mpc85xx_gpio_direction_output(struct udevice *dev, uint gpio,
 					 int value)
 {
 	return mpc85xx_gpio_set_value(dev, gpio, value);
 }
 
-static int mpc85xx_gpio_get_value(struct udevice *dev, unsigned gpio)
+static int mpc85xx_gpio_get_value(struct udevice *dev, uint gpio)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 
 	if (!!mpc85xx_gpio_get_dir(data->base, gpio_mask(gpio))) {
 		/* Output -> use shadowed value */
 		return !!(data->dat_shadow & gpio_mask(gpio));
-	} else {
-		/* Input -> read value from GPDAT register */
-		return !!mpc85xx_gpio_get_val(data->base, gpio_mask(gpio));
 	}
+
+	/* Input -> read value from GPDAT register */
+	return !!mpc85xx_gpio_get_val(data->base, gpio_mask(gpio));
 }
 
-static int mpc85xx_gpio_get_open_drain(struct udevice *dev, unsigned gpio)
+static int mpc85xx_gpio_get_open_drain(struct udevice *dev, uint gpio)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 
 	return !!mpc85xx_gpio_open_drain_val(data->base, gpio_mask(gpio));
 }
 
-static int mpc85xx_gpio_set_open_drain(struct udevice *dev, unsigned gpio,
+static int mpc85xx_gpio_set_open_drain(struct udevice *dev, uint gpio,
 				       int value)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 
-	if (value) {
+	if (value)
 		mpc85xx_gpio_open_drain_on(data->base, gpio_mask(gpio));
-	} else {
+	else
 		mpc85xx_gpio_open_drain_off(data->base, gpio_mask(gpio));
-	}
+
 	return 0;
 }
 
-static int mpc85xx_gpio_get_function(struct udevice *dev, unsigned gpio)
+static int mpc85xx_gpio_get_function(struct udevice *dev, uint gpio)
 {
 	struct mpc85xx_gpio_data *data = dev_get_priv(dev);
 	int dir;
@@ -164,14 +165,15 @@ static int mpc85xx_gpio_get_function(struct udevice *dev, unsigned gpio)
 }
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
-static int mpc85xx_gpio_ofdata_to_platdata(struct udevice *dev) {
+static int mpc85xx_gpio_ofdata_to_platdata(struct udevice *dev)
+{
 	struct mpc85xx_gpio_plat *plat = dev_get_platdata(dev);
 	fdt_addr_t addr;
 	fdt_size_t size;
 
 	addr = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob,
-			dev_of_offset(dev), "reg", 0, &size, false);
-
+						  dev_of_offset(dev),
+						  "reg", 0, &size, false);
 	plat->addr = addr;
 	plat->size = size;
 	plat->ngpios = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
@@ -229,7 +231,7 @@ static const struct dm_gpio_ops gpio_mpc85xx_ops = {
 	.set_value		= mpc85xx_gpio_set_value,
 	.get_open_drain		= mpc85xx_gpio_get_open_drain,
 	.set_open_drain		= mpc85xx_gpio_set_open_drain,
-	.get_function 		= mpc85xx_gpio_get_function,
+	.get_function		= mpc85xx_gpio_get_function,
 };
 
 static const struct udevice_id mpc85xx_gpio_ids[] = {
-- 
2.11.0

  parent reply	other threads:[~2017-09-29 12:52 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 12:51 [U-Boot] [PATCH 001/080] mpc8308rdb: Fix style violation Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 002/080] mpc83xx: spd_sdram: Fix whitespace style violations Mario Six
2017-09-29 14:03   ` Wolfgang Denk
2017-10-04  6:14     ` Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 003/080] mpc83xx: spd_sdram: Fix " Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 004/080] include: dm: Fix 'devioe'/'devuce' typos Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 005/080] lib: fdtdec: Fix whitespace style violations Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 006/080] lib: fdtdec: Fix some " Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 007/080] core: ofnode: Fix " Mario Six
2017-10-09  4:45   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 008/080] core: read: " Mario Six
2017-10-09  4:45   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 009/080] core: Add {ofnode, dev}_translate_address functions Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 010/080] core: Make device_is_compatible live-tree compatible Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 011/080] clk: clk-uclass: Fix style violations Mario Six
2017-10-09  4:46   ` Simon Glass
2017-10-09  8:10     ` Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 012/080] clk: clk_fixed_rate: Fix style violation Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 013/080] clk: Remove superfluous gd declarations Mario Six
2017-10-09  4:46   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 014/080] spi: Fix style violation and improve code Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 015/080] spi: Remove obsolete spi_base_setup_slave_fdt Mario Six
2017-10-09  4:46   ` Simon Glass
2017-10-09  9:32   ` Jagan Teki
2017-09-29 12:51 ` [U-Boot] [PATCH 016/080] spi: Remove spi_flash_probe_fdt Mario Six
2017-10-09  4:47   ` Simon Glass
2017-10-09  9:35   ` Jagan Teki
2017-09-29 12:51 ` [U-Boot] [PATCH 017/080] spi: Remove spi_setup_slave_fdt Mario Six
2017-10-09  4:47   ` Simon Glass
2017-10-09  9:36   ` Jagan Teki
2017-09-29 12:51 ` [U-Boot] [PATCH 018/080] spi: Remove CONFIG_OF_SPI_FLASH Mario Six
2017-10-09  4:46   ` Simon Glass
2017-10-09  9:34   ` Jagan Teki
2017-09-29 12:51 ` [U-Boot] [PATCH 019/080] spi: sf_probe: Fix style violations Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 020/080] spi: spi-uclass: " Mario Six
2017-10-09  4:47   ` Simon Glass
2017-10-09  9:36   ` Jagan Teki
2017-09-29 12:51 ` [U-Boot] [PATCH 021/080] sf_probe: Merge spi_flash_probe_tail into spi_flash_probe Mario Six
2017-10-09  4:47   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 022/080] net: tsec: Fix style violations Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 023/080] net: tsec: Fix memory leak in error path Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 024/080] net: tsec: Make live-tree compatible Mario Six
2017-10-09  4:47   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 025/080] i2c: fsl_i2c: Fix style violations Mario Six
2017-10-02  6:19   ` Heiko Schocher
2017-09-29 12:51 ` [U-Boot] [PATCH 026/080] i2c: fsl_i2c: Remove inline declarations Mario Six
2017-10-02  6:20   ` Heiko Schocher
2017-09-29 12:51 ` [U-Boot] [PATCH 027/080] i2c: fsl_i2c: Make live-tree compatible Mario Six
2017-10-02  6:20   ` Heiko Schocher
2017-09-29 12:51 ` [U-Boot] [PATCH 028/080] gpio: pca953x_gpio: Fix style violations Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 029/080] gpio: pca953x_gpio: Make live-tree compatible Mario Six
2017-10-09  4:47   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 030/080] serial: ns16550: Fix style violation Mario Six
2017-10-09  4:48   ` Simon Glass
2017-09-29 12:51 ` [U-Boot] [PATCH 031/080] serial: ns16550: Fix address translation Mario Six
2017-10-09  4:48   ` Simon Glass
2017-10-09 12:45     ` Mario Six
2017-10-09 12:55       ` Dr. Philipp Tomsich
2017-10-09 14:09         ` Simon Glass
2017-10-11 13:29           ` Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 032/080] gdsys: Post ppc4xx removal cleanup Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 033/080] net: phy: marvell: Fix style violations Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 034/080] net: phy: marvell 88e151x: Fix handling of bare RGMII interface type Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 035/080] cfi_flash: Fix space between function name and parenthesis Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 036/080] cfi_flash: Fix style of pointer declarations Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 037/080] cfi_flash: Fix Parenthesis spacing Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 038/080] cfi_flash: Fix whitespace with casting Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 039/080] cfi_flash: Fix indent of case statements Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 040/080] cfi_flash: Fix spacing around casts/operators Mario Six
2017-09-29 12:51 ` [U-Boot] [PATCH 041/080] cfi_flash: Fix missing/superfluous lines Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 042/080] cfi_flash: Remove braces for single-statement blocks Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 043/080] cfi_flash: Fix logical continuations Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 044/080] cfi_flash: Use __func__ macro instead of function name Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 045/080] cfi_flash: Fix comment style Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 046/080] cfi_flash: Remove unnecessary braces Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 047/080] cfi_flash: Add missing braces in blocks Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 048/080] cfi_flash: Fix spelling of "Unknown" Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 049/080] cfi_flash: Fix else after break Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 050/080] cfi_flash: Fix placement of brace Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 051/080] cfi_flash: Remove return from void function Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 052/080] cfi_flash: Reduce the scope of some variables Mario Six
2017-09-29 17:10   ` Masahiro Yamada
2017-10-04  6:23     ` Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 053/080] cfi_flash: Remove assignments from if conditions Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 054/080] cfi_flash: Use u8 pointers instead of void pointers Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 055/080] cfi_flash: Fix strings split across lines Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 056/080] cfi_flash: Rename camel-case variables Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 057/080] flash: Fix spelling of "ERR_TIMOUT" Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 058/080] cfi_flash: Bound-check index before array access Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 059/080] cfi_flash: Fix long lines Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 060/080] cfi_flash: Fix indention Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 061/080] cfi_flash: Always define cfi_flash_num_flash_banks Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 062/080] mtd: cfi_flash: Make live-tree compatible Mario Six
2017-09-29 12:52 ` Mario Six [this message]
2017-09-29 12:52 ` [U-Boot] [PATCH 064/080] gpio: mpc85xx: Rename driver file to mpc8xxx Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 065/080] gpio: mpc8xxx: Rename Kconfig option, structures, and functions Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 066/080] gpio: mpc8xxx: Make compatible with more SoCs Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 067/080] mpc83xx: Prepare usage of DM gpio driver Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 068/080] gpio: mpc8xxx: Make live-tree compatible Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 069/080] cmd: mdio: Fix style violations Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 070/080] common: board_f: " Mario Six
2017-10-09  4:48   ` Simon Glass
2017-09-29 12:52 ` [U-Boot] [PATCH 071/080] common: board_r: " Mario Six
2017-10-09  4:48   ` Simon Glass
2017-09-29 12:52 ` [U-Boot] [PATCH 072/080] gdsys: mpc8308: " Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 073/080] gdsys: mpc8308: Use shadow register for output GPIO values Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 074/080] strider, hrcon: Reset CAT phy on CON2 module Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 075/080] gdsys:phy: Adapt fixup_88e1518() to latest Release Notes Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 076/080] phy: Fix style violations Mario Six
2017-12-05 20:17   ` Joe Hershberger
2017-09-29 12:52 ` [U-Boot] [PATCH 077/080] i2c: ihs_i2c: Prepare DM conversion Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 078/080] i2c: ihs_i2c: Make DM compatible Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 079/080] i2c: ihs_i2c: Factor out send_buffer method Mario Six
2017-09-29 12:52 ` [U-Boot] [PATCH 080/080] clk: Makefile: Sort entries alphabetically Mario Six
2017-10-09  4:48   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170929125238.26226-63-mario.six@gdsys.cc \
    --to=mario.six@gdsys.cc \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.