aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorGary Servin <garyservin@gmail.com>2014-03-06 18:25:26 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-03-12 09:52:14 -0400
commit33bc8411eec33f92ba59e8ef7394b82245ec556e (patch)
tree67cbace96d47231ada5d88a387bad70df8916409 /drivers/gpio
parentf561b4230cec90137baeba1b1c9302461939b870 (diff)
gpio: mcp23s08: trivial: fixed coding style issues
This coding style issue was detected using the checkpatch.pl script Signed-off-by: Gary Servin <garyservin@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-mcp23s08.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 1ac288ea810d..e1734c114916 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -173,7 +173,7 @@ static int mcp23s08_read(struct mcp23s08 *mcp, unsigned reg)
173 173
174 tx[0] = mcp->addr | 0x01; 174 tx[0] = mcp->addr | 0x01;
175 tx[1] = reg; 175 tx[1] = reg;
176 status = spi_write_then_read(mcp->data, tx, sizeof tx, rx, sizeof rx); 176 status = spi_write_then_read(mcp->data, tx, sizeof(tx), rx, sizeof(rx));
177 return (status < 0) ? status : rx[0]; 177 return (status < 0) ? status : rx[0];
178} 178}
179 179
@@ -184,7 +184,7 @@ static int mcp23s08_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
184 tx[0] = mcp->addr; 184 tx[0] = mcp->addr;
185 tx[1] = reg; 185 tx[1] = reg;
186 tx[2] = val; 186 tx[2] = val;
187 return spi_write_then_read(mcp->data, tx, sizeof tx, NULL, 0); 187 return spi_write_then_read(mcp->data, tx, sizeof(tx), NULL, 0);
188} 188}
189 189
190static int 190static int
@@ -193,13 +193,13 @@ mcp23s08_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
193 u8 tx[2], *tmp; 193 u8 tx[2], *tmp;
194 int status; 194 int status;
195 195
196 if ((n + reg) > sizeof mcp->cache) 196 if ((n + reg) > sizeof(mcp->cache))
197 return -EINVAL; 197 return -EINVAL;
198 tx[0] = mcp->addr | 0x01; 198 tx[0] = mcp->addr | 0x01;
199 tx[1] = reg; 199 tx[1] = reg;
200 200
201 tmp = (u8 *)vals; 201 tmp = (u8 *)vals;
202 status = spi_write_then_read(mcp->data, tx, sizeof tx, tmp, n); 202 status = spi_write_then_read(mcp->data, tx, sizeof(tx), tmp, n);
203 if (status >= 0) { 203 if (status >= 0) {
204 while (n--) 204 while (n--)
205 vals[n] = tmp[n]; /* expand to 16bit */ 205 vals[n] = tmp[n]; /* expand to 16bit */
@@ -214,7 +214,7 @@ static int mcp23s17_read(struct mcp23s08 *mcp, unsigned reg)
214 214
215 tx[0] = mcp->addr | 0x01; 215 tx[0] = mcp->addr | 0x01;
216 tx[1] = reg << 1; 216 tx[1] = reg << 1;
217 status = spi_write_then_read(mcp->data, tx, sizeof tx, rx, sizeof rx); 217 status = spi_write_then_read(mcp->data, tx, sizeof(tx), rx, sizeof(rx));
218 return (status < 0) ? status : (rx[0] | (rx[1] << 8)); 218 return (status < 0) ? status : (rx[0] | (rx[1] << 8));
219} 219}
220 220
@@ -226,7 +226,7 @@ static int mcp23s17_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
226 tx[1] = reg << 1; 226 tx[1] = reg << 1;
227 tx[2] = val; 227 tx[2] = val;
228 tx[3] = val >> 8; 228 tx[3] = val >> 8;
229 return spi_write_then_read(mcp->data, tx, sizeof tx, NULL, 0); 229 return spi_write_then_read(mcp->data, tx, sizeof(tx), NULL, 0);
230} 230}
231 231
232static int 232static int
@@ -235,12 +235,12 @@ mcp23s17_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
235 u8 tx[2]; 235 u8 tx[2];
236 int status; 236 int status;
237 237
238 if ((n + reg) > sizeof mcp->cache) 238 if ((n + reg) > sizeof(mcp->cache))
239 return -EINVAL; 239 return -EINVAL;
240 tx[0] = mcp->addr | 0x01; 240 tx[0] = mcp->addr | 0x01;
241 tx[1] = reg << 1; 241 tx[1] = reg << 1;
242 242
243 status = spi_write_then_read(mcp->data, tx, sizeof tx, 243 status = spi_write_then_read(mcp->data, tx, sizeof(tx),
244 (u8 *)vals, n * 2); 244 (u8 *)vals, n * 2);
245 if (status >= 0) { 245 if (status >= 0) {
246 while (n--) 246 while (n--)
@@ -567,7 +567,7 @@ static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip)
567 (mcp->cache[MCP_GPIO] & mask) ? "hi" : "lo", 567 (mcp->cache[MCP_GPIO] & mask) ? "hi" : "lo",
568 (mcp->cache[MCP_GPPU] & mask) ? "up" : " "); 568 (mcp->cache[MCP_GPPU] & mask) ? "up" : " ");
569 /* NOTE: ignoring the irq-related registers */ 569 /* NOTE: ignoring the irq-related registers */
570 seq_printf(s, "\n"); 570 seq_puts(s, "\n");
571 } 571 }
572done: 572done:
573 mutex_unlock(&mcp->lock); 573 mutex_unlock(&mcp->lock);
@@ -789,7 +789,7 @@ static int mcp230xx_probe(struct i2c_client *client,
789 pullups = pdata->chip[0].pullups; 789 pullups = pdata->chip[0].pullups;
790 } 790 }
791 791
792 mcp = kzalloc(sizeof *mcp, GFP_KERNEL); 792 mcp = kzalloc(sizeof(*mcp), GFP_KERNEL);
793 if (!mcp) 793 if (!mcp)
794 return -ENOMEM; 794 return -ENOMEM;
795 795
@@ -925,7 +925,7 @@ static int mcp23s08_probe(struct spi_device *spi)
925 base = pdata->base; 925 base = pdata->base;
926 } 926 }
927 927
928 data = kzalloc(sizeof *data + chips * sizeof(struct mcp23s08), 928 data = kzalloc(sizeof(*data) + chips * sizeof(struct mcp23s08),
929 GFP_KERNEL); 929 GFP_KERNEL);
930 if (!data) 930 if (!data)
931 return -ENOMEM; 931 return -ENOMEM;