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

Configure Feed

Select the types of activity you want to include in your feed.

media: dw2102: Fix minor issues

Found by checkpatch.

Link: https://lore.kernel.org/linux-media/20220116112238.74171-4-micha@freedict.org
Signed-off-by: Michael Bunk <micha@freedict.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Michael Bunk and committed by
Mauro Carvalho Chehab
efc3e49d bd693f68

+48 -41
+48 -41
drivers/media/usb/dvb-usb/dw2102.c
··· 53 53 #define DW2102_FIRMWARE "dvb-usb-dw2102.fw" 54 54 #define DW2104_FIRMWARE "dvb-usb-dw2104.fw" 55 55 #define DW3101_FIRMWARE "dvb-usb-dw3101.fw" 56 - #define S630_FIRMWARE "dvb-usb-s630.fw" 57 - #define S660_FIRMWARE "dvb-usb-s660.fw" 58 - #define P1100_FIRMWARE "dvb-usb-p1100.fw" 59 - #define P7500_FIRMWARE "dvb-usb-p7500.fw" 56 + #define S630_FIRMWARE "dvb-usb-s630.fw" 57 + #define S660_FIRMWARE "dvb-usb-s660.fw" 58 + #define P1100_FIRMWARE "dvb-usb-p1100.fw" 59 + #define P7500_FIRMWARE "dvb-usb-p7500.fw" 60 60 61 61 #define err_str "did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware" 62 62 ··· 87 87 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 88 88 89 89 static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value, 90 - u16 index, u8 * data, u16 len, int flags) 90 + u16 index, u8 *data, u16 len, int flags) 91 91 { 92 92 int ret; 93 93 u8 *u8buf; ··· 103 103 if (flags == DW210X_WRITE_MSG) 104 104 memcpy(u8buf, data, len); 105 105 ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR, 106 - value, index , u8buf, len, 2000); 106 + value, index, u8buf, len, 2000); 107 107 108 108 if (flags == DW210X_READ_MSG) 109 109 memcpy(data, u8buf, len); ··· 322 322 dw210x_op_rw(d->udev, 0xc2, 0, 0, 323 323 obuf, msg[0].len + 2, DW210X_WRITE_MSG); 324 324 /* second read registers */ 325 - dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0, 325 + dw210x_op_rw(d->udev, 0xc3, 0xd1, 0, 326 326 ibuf, msg[1].len + 2, DW210X_READ_MSG); 327 327 memcpy(msg[1].buf, ibuf + 2, msg[1].len); 328 328 ··· 368 368 } 369 369 case(DW2102_RC_QUERY): { 370 370 u8 ibuf[2]; 371 + 371 372 dw210x_op_rw(d->udev, 0xb8, 0, 0, 372 373 ibuf, 2, DW210X_READ_MSG); 373 - memcpy(msg[0].buf, ibuf , 2); 374 + memcpy(msg[0].buf, ibuf, 2); 374 375 break; 375 376 } 376 377 case(DW2102_VOLTAGE_CTRL): { 377 378 u8 obuf[2]; 379 + 378 380 obuf[0] = 0x30; 379 381 obuf[1] = msg[0].buf[0]; 380 382 dw210x_op_rw(d->udev, 0xb2, 0, 0, ··· 408 406 switch (msg[j].addr) { 409 407 case(DW2102_RC_QUERY): { 410 408 u8 ibuf[2]; 409 + 411 410 dw210x_op_rw(d->udev, 0xb8, 0, 0, 412 411 ibuf, 2, DW210X_READ_MSG); 413 - memcpy(msg[j].buf, ibuf , 2); 412 + memcpy(msg[j].buf, ibuf, 2); 414 413 break; 415 414 } 416 415 case(DW2102_VOLTAGE_CTRL): { 417 416 u8 obuf[2]; 417 + 418 418 obuf[0] = 0x30; 419 419 obuf[1] = msg[j].buf[0]; 420 420 dw210x_op_rw(d->udev, 0xb2, 0, 0, 421 421 obuf, 2, DW210X_WRITE_MSG); 422 422 break; 423 423 } 424 - /*case 0x55: cx24116 425 - case 0x6a: stv0903 426 - case 0x68: ds3000, stv0903 427 - case 0x60: ts2020, stv6110, stb6100 */ 424 + /* case 0x55: cx24116 425 + * case 0x6a: stv0903 426 + * case 0x68: ds3000, stv0903 427 + * case 0x60: ts2020, stv6110, stb6100 428 + */ 428 429 default: { 429 430 if (msg[j].flags == I2C_M_RD) { 430 431 /* read registers */ ··· 452 447 (msg[j].addr == 0x55))) { 453 448 /* write firmware */ 454 449 u8 obuf[19]; 450 + 455 451 obuf[0] = msg[j].addr << 1; 456 452 obuf[1] = (msg[j].len > 15 ? 17 : msg[j].len); 457 453 obuf[2] = msg[j].buf[0]; ··· 533 527 dw210x_op_rw(d->udev, 0xc2, 0, 0, 534 528 obuf, msg[0].len + 2, DW210X_WRITE_MSG); 535 529 /* second read registers */ 536 - dw210x_op_rw(d->udev, 0xc3, 0x19 , 0, 530 + dw210x_op_rw(d->udev, 0xc3, 0x19, 0, 537 531 ibuf, msg[1].len + 2, DW210X_READ_MSG); 538 532 memcpy(msg[1].buf, ibuf + 2, msg[1].len); 539 533 ··· 561 555 } 562 556 case(DW2102_RC_QUERY): { 563 557 u8 ibuf[2]; 558 + 564 559 dw210x_op_rw(d->udev, 0xb8, 0, 0, 565 560 ibuf, 2, DW210X_READ_MSG); 566 - memcpy(msg[0].buf, ibuf , 2); 561 + memcpy(msg[0].buf, ibuf, 2); 567 562 break; 568 563 } 569 564 } ··· 601 594 switch (msg[j].addr) { 602 595 case (DW2102_RC_QUERY): { 603 596 u8 ibuf[5]; 597 + 604 598 dw210x_op_rw(d->udev, 0xb8, 0, 0, 605 599 ibuf, 5, DW210X_READ_MSG); 606 600 memcpy(msg[j].buf, ibuf + 3, 2); ··· 629 621 obuf, 2, DW210X_WRITE_MSG); 630 622 break; 631 623 } 632 - /*case 0x55: cx24116 633 - case 0x6a: stv0903 634 - case 0x68: ds3000, stv0903, rs2000 635 - case 0x60: ts2020, stv6110, stb6100 636 - case 0xa0: eeprom */ 624 + /* case 0x55: cx24116 625 + * case 0x6a: stv0903 626 + * case 0x68: ds3000, stv0903, rs2000 627 + * case 0x60: ts2020, stv6110, stb6100 628 + * case 0xa0: eeprom 629 + */ 637 630 default: { 638 631 if (msg[j].flags == I2C_M_RD) { 639 632 /* read registers */ ··· 656 647 (msg[j].addr == 0x68)) { 657 648 /* write firmware */ 658 649 u8 obuf[19]; 650 + 659 651 obuf[0] = (msg[j].len > 16 ? 660 652 18 : msg[j].len + 1); 661 653 obuf[1] = msg[j].addr << 1; ··· 1019 1009 const struct dvb_usb_device_description **desc, 1020 1010 int *cold) 1021 1011 { 1022 - info("%s", __func__); 1023 - 1024 1012 *cold = 0; 1025 1013 return 0; 1026 1014 } ··· 1374 1366 if (d->fe_adap[0].fe == NULL) 1375 1367 return -EIO; 1376 1368 1377 - if (NULL == dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61, &d->dev->i2c_adap)) 1369 + if (dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61, &d->dev->i2c_adap) == NULL) 1378 1370 return -EIO; 1379 1371 1380 1372 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; ··· 1911 1903 memcpy(p, fw->data, fw->size); 1912 1904 for (i = 0; i < fw->size; i += 0x40) { 1913 1905 b = (u8 *) p + i; 1914 - if (dw210x_op_rw(dev, 0xa0, i, 0, b , 0x40, 1906 + if (dw210x_op_rw(dev, 0xa0, i, 0, b, 0x40, 1915 1907 DW210X_WRITE_MSG) != 0x40) { 1916 1908 err("error while transferring firmware"); 1917 1909 ret = -EINVAL; ··· 1958 1950 dw2102_properties.i2c_algo = &dw2102_i2c_algo; 1959 1951 dw2102_properties.adapter->fe[0].tuner_attach = &dw2102_tuner_attach; 1960 1952 break; 1961 - } else { 1962 - /* check STV0288 frontend */ 1963 - reset16[0] = 0xd0; 1964 - reset16[1] = 1; 1965 - reset16[2] = 0; 1966 - dw210x_op_rw(dev, 0xc2, 0, 0, &reset16[0], 3, 1967 - DW210X_WRITE_MSG); 1968 - dw210x_op_rw(dev, 0xc3, 0xd1, 0, &reset16[0], 3, 1969 - DW210X_READ_MSG); 1970 - if (reset16[2] == 0x11) { 1971 - dw2102_properties.i2c_algo = &dw2102_earda_i2c_algo; 1972 - break; 1973 - } 1953 + } 1954 + /* check STV0288 frontend */ 1955 + reset16[0] = 0xd0; 1956 + reset16[1] = 1; 1957 + reset16[2] = 0; 1958 + dw210x_op_rw(dev, 0xc2, 0, 0, &reset16[0], 3, 1959 + DW210X_WRITE_MSG); 1960 + dw210x_op_rw(dev, 0xc3, 0xd1, 0, &reset16[0], 3, 1961 + DW210X_READ_MSG); 1962 + if (reset16[2] == 0x11) { 1963 + dw2102_properties.i2c_algo = &dw2102_earda_i2c_algo; 1964 + break; 1974 1965 } 1975 1966 fallthrough; 1976 1967 case 0x2101: ··· 2596 2589 const struct usb_device_id *id) 2597 2590 { 2598 2591 if (!(dvb_usb_device_init(intf, &dw2102_properties, 2599 - THIS_MODULE, NULL, adapter_nr) && 2592 + THIS_MODULE, NULL, adapter_nr) && 2600 2593 dvb_usb_device_init(intf, &dw2104_properties, 2601 2594 THIS_MODULE, NULL, adapter_nr) && 2602 2595 dvb_usb_device_init(intf, &dw3101_properties, 2603 - THIS_MODULE, NULL, adapter_nr) && 2596 + THIS_MODULE, NULL, adapter_nr) && 2604 2597 dvb_usb_device_init(intf, &s6x0_properties, 2605 - THIS_MODULE, NULL, adapter_nr) && 2598 + THIS_MODULE, NULL, adapter_nr) && 2606 2599 dvb_usb_device_init(intf, &p1100_properties, 2607 - THIS_MODULE, NULL, adapter_nr) && 2600 + THIS_MODULE, NULL, adapter_nr) && 2608 2601 dvb_usb_device_init(intf, &s660_properties, 2609 2602 THIS_MODULE, NULL, adapter_nr) && 2610 2603 dvb_usb_device_init(intf, &p7500_properties,