Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: ali1563: fix checkpatch.pl issues

Fixed most checkpatch.pl issues

Signed-off-by: Richard Leitner <me@g0hl1n.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Richard Leitner and committed by
Wolfram Sang
482116ba 9219982b

+45 -37
+45 -37
drivers/i2c/busses/i2c-ali1563.c
··· 63 63 static struct pci_driver ali1563_pci_driver; 64 64 static unsigned short ali1563_smba; 65 65 66 - static int ali1563_transaction(struct i2c_adapter * a, int size) 66 + static int ali1563_transaction(struct i2c_adapter *a, int size) 67 67 { 68 68 u32 data; 69 69 int timeout; ··· 78 78 data = inb_p(SMB_HST_STS); 79 79 if (data & HST_STS_BAD) { 80 80 dev_err(&a->dev, "ali1563: Trying to reset busy device\n"); 81 - outb_p(data | HST_STS_BAD,SMB_HST_STS); 81 + outb_p(data | HST_STS_BAD, SMB_HST_STS); 82 82 data = inb_p(SMB_HST_STS); 83 83 if (data & HST_STS_BAD) 84 84 return -EBUSY; ··· 102 102 if (!timeout) { 103 103 dev_err(&a->dev, "Timeout - Trying to KILL transaction!\n"); 104 104 /* Issue 'kill' to host controller */ 105 - outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2); 105 + outb_p(HST_CNTL2_KILL, SMB_HST_CNTL2); 106 106 data = inb_p(SMB_HST_STS); 107 107 status = -ETIMEDOUT; 108 - } 108 + } 109 109 110 110 /* device error - no response, ignore the autodetection case */ 111 111 if (data & HST_STS_DEVERR) { ··· 117 117 if (data & HST_STS_BUSERR) { 118 118 dev_err(&a->dev, "Bus collision!\n"); 119 119 /* Issue timeout, hoping it helps */ 120 - outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1); 120 + outb_p(HST_CNTL1_TIMEOUT, SMB_HST_CNTL1); 121 121 } 122 122 123 123 if (data & HST_STS_FAIL) { 124 124 dev_err(&a->dev, "Cleaning fail after KILL!\n"); 125 - outb_p(0x0,SMB_HST_CNTL2); 125 + outb_p(0x0, SMB_HST_CNTL2); 126 126 } 127 127 128 128 return status; 129 129 } 130 130 131 - static int ali1563_block_start(struct i2c_adapter * a) 131 + static int ali1563_block_start(struct i2c_adapter *a) 132 132 { 133 133 u32 data; 134 134 int timeout; ··· 142 142 143 143 data = inb_p(SMB_HST_STS); 144 144 if (data & HST_STS_BAD) { 145 - dev_warn(&a->dev,"ali1563: Trying to reset busy device\n"); 146 - outb_p(data | HST_STS_BAD,SMB_HST_STS); 145 + dev_warn(&a->dev, "ali1563: Trying to reset busy device\n"); 146 + outb_p(data | HST_STS_BAD, SMB_HST_STS); 147 147 data = inb_p(SMB_HST_STS); 148 148 if (data & HST_STS_BAD) 149 149 return -EBUSY; ··· 184 184 return status; 185 185 } 186 186 187 - static int ali1563_block(struct i2c_adapter * a, union i2c_smbus_data * data, u8 rw) 187 + static int ali1563_block(struct i2c_adapter *a, 188 + union i2c_smbus_data *data, u8 rw) 188 189 { 189 190 int i, len; 190 191 int error = 0; 191 192 192 193 /* Do we need this? */ 193 - outb_p(HST_CNTL1_LAST,SMB_HST_CNTL1); 194 + outb_p(HST_CNTL1_LAST, SMB_HST_CNTL1); 194 195 195 196 if (rw == I2C_SMBUS_WRITE) { 196 197 len = data->block[0]; ··· 199 198 len = 1; 200 199 else if (len > 32) 201 200 len = 32; 202 - outb_p(len,SMB_HST_DAT0); 203 - outb_p(data->block[1],SMB_BLK_DAT); 201 + outb_p(len, SMB_HST_DAT0); 202 + outb_p(data->block[1], SMB_BLK_DAT); 204 203 } else 205 204 len = 32; 206 205 ··· 209 208 for (i = 0; i < len; i++) { 210 209 if (rw == I2C_SMBUS_WRITE) { 211 210 outb_p(data->block[i + 1], SMB_BLK_DAT); 212 - if ((error = ali1563_block_start(a))) 211 + error = ali1563_block_start(a); 212 + if (error) 213 213 break; 214 214 } else { 215 - if ((error = ali1563_block_start(a))) 215 + error = ali1563_block_start(a); 216 + if (error) 216 217 break; 217 218 if (i == 0) { 218 219 len = inb_p(SMB_HST_DAT0); ··· 227 224 } 228 225 } 229 226 /* Do we need this? */ 230 - outb_p(HST_CNTL1_LAST,SMB_HST_CNTL1); 227 + outb_p(HST_CNTL1_LAST, SMB_HST_CNTL1); 231 228 return error; 232 229 } 233 230 234 - static s32 ali1563_access(struct i2c_adapter * a, u16 addr, 231 + static s32 ali1563_access(struct i2c_adapter *a, u16 addr, 235 232 unsigned short flags, char rw, u8 cmd, 236 - int size, union i2c_smbus_data * data) 233 + int size, union i2c_smbus_data *data) 237 234 { 238 235 int error = 0; 239 236 int timeout; 240 237 u32 reg; 241 238 242 239 for (timeout = ALI1563_MAX_TIMEOUT; timeout; timeout--) { 243 - if (!(reg = inb_p(SMB_HST_STS) & HST_STS_BUSY)) 240 + reg = inb_p(SMB_HST_STS); 241 + if (!(reg & HST_STS_BUSY)) 244 242 break; 245 243 } 246 244 if (!timeout) 247 - dev_warn(&a->dev,"SMBus not idle. HST_STS = %02x\n",reg); 248 - outb_p(0xff,SMB_HST_STS); 245 + dev_warn(&a->dev, "SMBus not idle. HST_STS = %02x\n", reg); 246 + outb_p(0xff, SMB_HST_STS); 249 247 250 248 /* Map the size to what the chip understands */ 251 249 switch (size) { ··· 272 268 } 273 269 274 270 outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD); 275 - outb_p((inb_p(SMB_HST_CNTL2) & ~HST_CNTL2_SIZEMASK) | (size << 3), SMB_HST_CNTL2); 271 + outb_p((inb_p(SMB_HST_CNTL2) & ~HST_CNTL2_SIZEMASK) | 272 + (size << 3), SMB_HST_CNTL2); 276 273 277 274 /* Write the command register */ 278 275 279 - switch(size) { 276 + switch (size) { 280 277 case HST_CNTL2_BYTE: 281 - if (rw== I2C_SMBUS_WRITE) 278 + if (rw == I2C_SMBUS_WRITE) 282 279 /* Beware it uses DAT0 register and not CMD! */ 283 280 outb_p(cmd, SMB_HST_DAT0); 284 281 break; ··· 297 292 break; 298 293 case HST_CNTL2_BLOCK: 299 294 outb_p(cmd, SMB_HST_CMD); 300 - error = ali1563_block(a,data,rw); 295 + error = ali1563_block(a, data, rw); 301 296 goto Done; 302 297 } 303 298 304 - if ((error = ali1563_transaction(a, size))) 299 + error = ali1563_transaction(a, size); 300 + if (error) 305 301 goto Done; 306 302 307 303 if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK)) ··· 323 317 return error; 324 318 } 325 319 326 - static u32 ali1563_func(struct i2c_adapter * a) 320 + static u32 ali1563_func(struct i2c_adapter *a) 327 321 { 328 322 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 329 323 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | ··· 335 329 { 336 330 u16 ctrl; 337 331 338 - pci_read_config_word(dev,ALI1563_SMBBA,&ctrl); 332 + pci_read_config_word(dev, ALI1563_SMBBA, &ctrl); 339 333 340 334 /* SMB I/O Base in high 12 bits and must be aligned with the 341 335 * size of the I/O space. */ 342 336 ali1563_smba = ctrl & ~(ALI1563_SMB_IOSIZE - 1); 343 337 if (!ali1563_smba) { 344 - dev_warn(&dev->dev,"ali1563_smba Uninitialized\n"); 338 + dev_warn(&dev->dev, "ali1563_smba Uninitialized\n"); 345 339 goto Err; 346 340 } 347 341 ··· 356 350 ctrl | ALI1563_SMB_IOEN); 357 351 pci_read_config_word(dev, ALI1563_SMBBA, &ctrl); 358 352 if (!(ctrl & ALI1563_SMB_IOEN)) { 359 - dev_err(&dev->dev, "I/O space still not enabled, " 360 - "giving up\n"); 353 + dev_err(&dev->dev, 354 + "I/O space still not enabled, giving up\n"); 361 355 goto Err; 362 356 } 363 357 } ··· 381 375 382 376 static void ali1563_shutdown(struct pci_dev *dev) 383 377 { 384 - release_region(ali1563_smba,ALI1563_SMB_IOSIZE); 378 + release_region(ali1563_smba, ALI1563_SMB_IOSIZE); 385 379 } 386 380 387 381 static const struct i2c_algorithm ali1563_algorithm = { ··· 400 394 { 401 395 int error; 402 396 403 - if ((error = ali1563_setup(dev))) 397 + error = ali1563_setup(dev); 398 + if (error) 404 399 goto exit; 405 400 ali1563_adapter.dev.parent = &dev->dev; 406 401 snprintf(ali1563_adapter.name, sizeof(ali1563_adapter.name), 407 402 "SMBus ALi 1563 Adapter @ %04x", ali1563_smba); 408 - if ((error = i2c_add_adapter(&ali1563_adapter))) 403 + error = i2c_add_adapter(&ali1563_adapter); 404 + if (error) 409 405 goto exit_shutdown; 410 406 return 0; 411 407 ··· 429 421 {}, 430 422 }; 431 423 432 - MODULE_DEVICE_TABLE (pci, ali1563_id_table); 424 + MODULE_DEVICE_TABLE(pci, ali1563_id_table); 433 425 434 426 static struct pci_driver ali1563_pci_driver = { 435 - .name = "ali1563_smbus", 427 + .name = "ali1563_smbus", 436 428 .id_table = ali1563_id_table, 437 - .probe = ali1563_probe, 429 + .probe = ali1563_probe, 438 430 .remove = ali1563_remove, 439 431 }; 440 432