aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-12-10 15:21:31 -0500
committerJean Delvare <khali@arrakis.delvare>2006-12-10 15:21:31 -0500
commit438d6c2c015cf63bf7e9bdc2033d435433ac8455 (patch)
tree12194d5fa00e09006f4fa332d2c4a8635b0ebc66 /drivers/i2c/i2c-dev.c
parent2c003e8e1c0c241aec162ba9ec781089c5b2ff3f (diff)
i2c: Whitespace cleanups
Remove extraneous whitespace from various i2c headers and core files, like space-before-tab and whitespace at end of line. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r--drivers/i2c/i2c-dev.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index d66cefc63df7..cf9381eae8da 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -1,5 +1,5 @@
1/* 1/*
2 i2c-dev.c - i2c-bus driver, char device interface 2 i2c-dev.c - i2c-bus driver, char device interface
3 3
4 Copyright (C) 1995-97 Simon G. Vogl 4 Copyright (C) 1995-97 Simon G. Vogl
5 Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl> 5 Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
@@ -172,7 +172,7 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
172 switch ( cmd ) { 172 switch ( cmd ) {
173 case I2C_SLAVE: 173 case I2C_SLAVE:
174 case I2C_SLAVE_FORCE: 174 case I2C_SLAVE_FORCE:
175 if ((arg > 0x3ff) || 175 if ((arg > 0x3ff) ||
176 (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f)) 176 (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
177 return -EINVAL; 177 return -EINVAL;
178 if ((cmd == I2C_SLAVE) && i2c_check_addr(client->adapter,arg)) 178 if ((cmd == I2C_SLAVE) && i2c_check_addr(client->adapter,arg))
@@ -196,8 +196,8 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
196 return put_user(funcs, (unsigned long __user *)arg); 196 return put_user(funcs, (unsigned long __user *)arg);
197 197
198 case I2C_RDWR: 198 case I2C_RDWR:
199 if (copy_from_user(&rdwr_arg, 199 if (copy_from_user(&rdwr_arg,
200 (struct i2c_rdwr_ioctl_data __user *)arg, 200 (struct i2c_rdwr_ioctl_data __user *)arg,
201 sizeof(rdwr_arg))) 201 sizeof(rdwr_arg)))
202 return -EFAULT; 202 return -EFAULT;
203 203
@@ -205,9 +205,9 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
205 * be sent at once */ 205 * be sent at once */
206 if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) 206 if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
207 return -EINVAL; 207 return -EINVAL;
208 208
209 rdwr_pa = (struct i2c_msg *) 209 rdwr_pa = (struct i2c_msg *)
210 kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), 210 kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg),
211 GFP_KERNEL); 211 GFP_KERNEL);
212 212
213 if (rdwr_pa == NULL) return -ENOMEM; 213 if (rdwr_pa == NULL) return -ENOMEM;
@@ -277,9 +277,9 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
277 (struct i2c_smbus_ioctl_data __user *) arg, 277 (struct i2c_smbus_ioctl_data __user *) arg,
278 sizeof(struct i2c_smbus_ioctl_data))) 278 sizeof(struct i2c_smbus_ioctl_data)))
279 return -EFAULT; 279 return -EFAULT;
280 if ((data_arg.size != I2C_SMBUS_BYTE) && 280 if ((data_arg.size != I2C_SMBUS_BYTE) &&
281 (data_arg.size != I2C_SMBUS_QUICK) && 281 (data_arg.size != I2C_SMBUS_QUICK) &&
282 (data_arg.size != I2C_SMBUS_BYTE_DATA) && 282 (data_arg.size != I2C_SMBUS_BYTE_DATA) &&
283 (data_arg.size != I2C_SMBUS_WORD_DATA) && 283 (data_arg.size != I2C_SMBUS_WORD_DATA) &&
284 (data_arg.size != I2C_SMBUS_PROC_CALL) && 284 (data_arg.size != I2C_SMBUS_PROC_CALL) &&
285 (data_arg.size != I2C_SMBUS_BLOCK_DATA) && 285 (data_arg.size != I2C_SMBUS_BLOCK_DATA) &&
@@ -290,11 +290,11 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
290 data_arg.size); 290 data_arg.size);
291 return -EINVAL; 291 return -EINVAL;
292 } 292 }
293 /* Note that I2C_SMBUS_READ and I2C_SMBUS_WRITE are 0 and 1, 293 /* Note that I2C_SMBUS_READ and I2C_SMBUS_WRITE are 0 and 1,
294 so the check is valid if size==I2C_SMBUS_QUICK too. */ 294 so the check is valid if size==I2C_SMBUS_QUICK too. */
295 if ((data_arg.read_write != I2C_SMBUS_READ) && 295 if ((data_arg.read_write != I2C_SMBUS_READ) &&
296 (data_arg.read_write != I2C_SMBUS_WRITE)) { 296 (data_arg.read_write != I2C_SMBUS_WRITE)) {
297 dev_dbg(&client->adapter->dev, 297 dev_dbg(&client->adapter->dev,
298 "read_write out of range (%x) in ioctl I2C_SMBUS.\n", 298 "read_write out of range (%x) in ioctl I2C_SMBUS.\n",
299 data_arg.read_write); 299 data_arg.read_write);
300 return -EINVAL; 300 return -EINVAL;
@@ -303,7 +303,7 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
303 /* Note that command values are always valid! */ 303 /* Note that command values are always valid! */
304 304
305 if ((data_arg.size == I2C_SMBUS_QUICK) || 305 if ((data_arg.size == I2C_SMBUS_QUICK) ||
306 ((data_arg.size == I2C_SMBUS_BYTE) && 306 ((data_arg.size == I2C_SMBUS_BYTE) &&
307 (data_arg.read_write == I2C_SMBUS_WRITE))) 307 (data_arg.read_write == I2C_SMBUS_WRITE)))
308 /* These are special: we do not use data */ 308 /* These are special: we do not use data */
309 return i2c_smbus_xfer(client->adapter, client->addr, 309 return i2c_smbus_xfer(client->adapter, client->addr,
@@ -321,14 +321,14 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
321 if ((data_arg.size == I2C_SMBUS_BYTE_DATA) || 321 if ((data_arg.size == I2C_SMBUS_BYTE_DATA) ||
322 (data_arg.size == I2C_SMBUS_BYTE)) 322 (data_arg.size == I2C_SMBUS_BYTE))
323 datasize = sizeof(data_arg.data->byte); 323 datasize = sizeof(data_arg.data->byte);
324 else if ((data_arg.size == I2C_SMBUS_WORD_DATA) || 324 else if ((data_arg.size == I2C_SMBUS_WORD_DATA) ||
325 (data_arg.size == I2C_SMBUS_PROC_CALL)) 325 (data_arg.size == I2C_SMBUS_PROC_CALL))
326 datasize = sizeof(data_arg.data->word); 326 datasize = sizeof(data_arg.data->word);
327 else /* size == smbus block, i2c block, or block proc. call */ 327 else /* size == smbus block, i2c block, or block proc. call */
328 datasize = sizeof(data_arg.data->block); 328 datasize = sizeof(data_arg.data->block);
329 329
330 if ((data_arg.size == I2C_SMBUS_PROC_CALL) || 330 if ((data_arg.size == I2C_SMBUS_PROC_CALL) ||
331 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) || 331 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) ||
332 (data_arg.read_write == I2C_SMBUS_WRITE)) { 332 (data_arg.read_write == I2C_SMBUS_WRITE)) {
333 if (copy_from_user(&temp, data_arg.data, datasize)) 333 if (copy_from_user(&temp, data_arg.data, datasize))
334 return -EFAULT; 334 return -EFAULT;
@@ -336,8 +336,8 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
336 res = i2c_smbus_xfer(client->adapter,client->addr,client->flags, 336 res = i2c_smbus_xfer(client->adapter,client->addr,client->flags,
337 data_arg.read_write, 337 data_arg.read_write,
338 data_arg.command,data_arg.size,&temp); 338 data_arg.command,data_arg.size,&temp);
339 if (! res && ((data_arg.size == I2C_SMBUS_PROC_CALL) || 339 if (! res && ((data_arg.size == I2C_SMBUS_PROC_CALL) ||
340 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) || 340 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) ||
341 (data_arg.read_write == I2C_SMBUS_READ))) { 341 (data_arg.read_write == I2C_SMBUS_READ))) {
342 if (copy_to_user(data_arg.data, &temp, datasize)) 342 if (copy_to_user(data_arg.data, &temp, datasize))
343 return -EFAULT; 343 return -EFAULT;