diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2016-07-26 03:09:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-22 11:56:15 -0400 |
commit | aa15544909918f55299b49bd51042e242e64c425 (patch) | |
tree | 1ac4762b1a08d63f1ad5b389efbca2de8f8552b4 | |
parent | 81fd533a972a28f43b080fe7fdc473dac3e988c6 (diff) |
[media] si2165: use i2c_client->dev instead of i2c_adapter->dev for logging
Now that there is a i2c_client, use the more specific dev for logging.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/dvb-frontends/si2165.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c index 5f8081c222b9..78543872d89d 100644 --- a/drivers/media/dvb-frontends/si2165.c +++ b/drivers/media/dvb-frontends/si2165.c | |||
@@ -114,7 +114,7 @@ static int si2165_write(struct si2165_state *state, const u16 reg, | |||
114 | u8 buf[2 + 4]; /* write a maximum of 4 bytes of data */ | 114 | u8 buf[2 + 4]; /* write a maximum of 4 bytes of data */ |
115 | 115 | ||
116 | if (count + 2 > sizeof(buf)) { | 116 | if (count + 2 > sizeof(buf)) { |
117 | dev_warn(&state->i2c->dev, | 117 | dev_warn(&state->client->dev, |
118 | "%s: i2c wr reg=%04x: count=%d is too big!\n", | 118 | "%s: i2c wr reg=%04x: count=%d is too big!\n", |
119 | KBUILD_MODNAME, reg, count); | 119 | KBUILD_MODNAME, reg, count); |
120 | return -EINVAL; | 120 | return -EINVAL; |
@@ -134,7 +134,7 @@ static int si2165_write(struct si2165_state *state, const u16 reg, | |||
134 | ret = i2c_transfer(state->i2c, &msg, 1); | 134 | ret = i2c_transfer(state->i2c, &msg, 1); |
135 | 135 | ||
136 | if (ret != 1) { | 136 | if (ret != 1) { |
137 | dev_err(&state->i2c->dev, "%s: ret == %d\n", __func__, ret); | 137 | dev_err(&state->client->dev, "%s: ret == %d\n", __func__, ret); |
138 | if (ret < 0) | 138 | if (ret < 0) |
139 | return ret; | 139 | return ret; |
140 | else | 140 | else |
@@ -159,7 +159,7 @@ static int si2165_read(struct si2165_state *state, | |||
159 | ret = i2c_transfer(state->i2c, msg, 2); | 159 | ret = i2c_transfer(state->i2c, msg, 2); |
160 | 160 | ||
161 | if (ret != 2) { | 161 | if (ret != 2) { |
162 | dev_err(&state->i2c->dev, "%s: error (addr %02x reg %04x error (ret == %i)\n", | 162 | dev_err(&state->client->dev, "%s: error (addr %02x reg %04x error (ret == %i)\n", |
163 | __func__, state->config.i2c_addr, reg, ret); | 163 | __func__, state->config.i2c_addr, reg, ret); |
164 | if (ret < 0) | 164 | if (ret < 0) |
165 | return ret; | 165 | return ret; |
@@ -347,7 +347,7 @@ static int si2165_wait_init_done(struct si2165_state *state) | |||
347 | return 0; | 347 | return 0; |
348 | usleep_range(1000, 50000); | 348 | usleep_range(1000, 50000); |
349 | } | 349 | } |
350 | dev_err(&state->i2c->dev, "%s: init_done was not set\n", | 350 | dev_err(&state->client->dev, "%s: init_done was not set\n", |
351 | KBUILD_MODNAME); | 351 | KBUILD_MODNAME); |
352 | return ret; | 352 | return ret; |
353 | } | 353 | } |
@@ -376,14 +376,14 @@ static int si2165_upload_firmware_block(struct si2165_state *state, | |||
376 | wordcount = data[offset]; | 376 | wordcount = data[offset]; |
377 | if (wordcount < 1 || data[offset+1] || | 377 | if (wordcount < 1 || data[offset+1] || |
378 | data[offset+2] || data[offset+3]) { | 378 | data[offset+2] || data[offset+3]) { |
379 | dev_warn(&state->i2c->dev, | 379 | dev_warn(&state->client->dev, |
380 | "%s: bad fw data[0..3] = %*ph\n", | 380 | "%s: bad fw data[0..3] = %*ph\n", |
381 | KBUILD_MODNAME, 4, data); | 381 | KBUILD_MODNAME, 4, data); |
382 | return -EINVAL; | 382 | return -EINVAL; |
383 | } | 383 | } |
384 | 384 | ||
385 | if (offset + 8 + wordcount * 4 > len) { | 385 | if (offset + 8 + wordcount * 4 > len) { |
386 | dev_warn(&state->i2c->dev, | 386 | dev_warn(&state->client->dev, |
387 | "%s: len is too small for block len=%d, wordcount=%d\n", | 387 | "%s: len is too small for block len=%d, wordcount=%d\n", |
388 | KBUILD_MODNAME, len, wordcount); | 388 | KBUILD_MODNAME, len, wordcount); |
389 | return -EINVAL; | 389 | return -EINVAL; |
@@ -446,15 +446,15 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
446 | fw_file = SI2165_FIRMWARE_REV_D; | 446 | fw_file = SI2165_FIRMWARE_REV_D; |
447 | break; | 447 | break; |
448 | default: | 448 | default: |
449 | dev_info(&state->i2c->dev, "%s: no firmware file for revision=%d\n", | 449 | dev_info(&state->client->dev, "%s: no firmware file for revision=%d\n", |
450 | KBUILD_MODNAME, state->chip_revcode); | 450 | KBUILD_MODNAME, state->chip_revcode); |
451 | return 0; | 451 | return 0; |
452 | } | 452 | } |
453 | 453 | ||
454 | /* request the firmware, this will block and timeout */ | 454 | /* request the firmware, this will block and timeout */ |
455 | ret = request_firmware(&fw, fw_file, state->i2c->dev.parent); | 455 | ret = request_firmware(&fw, fw_file, &state->client->dev); |
456 | if (ret) { | 456 | if (ret) { |
457 | dev_warn(&state->i2c->dev, "%s: firmware file '%s' not found\n", | 457 | dev_warn(&state->client->dev, "%s: firmware file '%s' not found\n", |
458 | KBUILD_MODNAME, fw_file); | 458 | KBUILD_MODNAME, fw_file); |
459 | goto error; | 459 | goto error; |
460 | } | 460 | } |
@@ -462,11 +462,11 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
462 | data = fw->data; | 462 | data = fw->data; |
463 | len = fw->size; | 463 | len = fw->size; |
464 | 464 | ||
465 | dev_info(&state->i2c->dev, "%s: downloading firmware from file '%s' size=%d\n", | 465 | dev_info(&state->client->dev, "%s: downloading firmware from file '%s' size=%d\n", |
466 | KBUILD_MODNAME, fw_file, len); | 466 | KBUILD_MODNAME, fw_file, len); |
467 | 467 | ||
468 | if (len % 4 != 0) { | 468 | if (len % 4 != 0) { |
469 | dev_warn(&state->i2c->dev, "%s: firmware size is not multiple of 4\n", | 469 | dev_warn(&state->client->dev, "%s: firmware size is not multiple of 4\n", |
470 | KBUILD_MODNAME); | 470 | KBUILD_MODNAME); |
471 | ret = -EINVAL; | 471 | ret = -EINVAL; |
472 | goto error; | 472 | goto error; |
@@ -474,14 +474,14 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
474 | 474 | ||
475 | /* check header (8 bytes) */ | 475 | /* check header (8 bytes) */ |
476 | if (len < 8) { | 476 | if (len < 8) { |
477 | dev_warn(&state->i2c->dev, "%s: firmware header is missing\n", | 477 | dev_warn(&state->client->dev, "%s: firmware header is missing\n", |
478 | KBUILD_MODNAME); | 478 | KBUILD_MODNAME); |
479 | ret = -EINVAL; | 479 | ret = -EINVAL; |
480 | goto error; | 480 | goto error; |
481 | } | 481 | } |
482 | 482 | ||
483 | if (data[0] != 1 || data[1] != 0) { | 483 | if (data[0] != 1 || data[1] != 0) { |
484 | dev_warn(&state->i2c->dev, "%s: firmware file version is wrong\n", | 484 | dev_warn(&state->client->dev, "%s: firmware file version is wrong\n", |
485 | KBUILD_MODNAME); | 485 | KBUILD_MODNAME); |
486 | ret = -EINVAL; | 486 | ret = -EINVAL; |
487 | goto error; | 487 | goto error; |
@@ -519,7 +519,7 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
519 | /* start right after the header */ | 519 | /* start right after the header */ |
520 | offset = 8; | 520 | offset = 8; |
521 | 521 | ||
522 | dev_info(&state->i2c->dev, "%s: si2165_upload_firmware extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n", | 522 | dev_info(&state->client->dev, "%s: si2165_upload_firmware extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n", |
523 | KBUILD_MODNAME, patch_version, block_count, crc_expected); | 523 | KBUILD_MODNAME, patch_version, block_count, crc_expected); |
524 | 524 | ||
525 | ret = si2165_upload_firmware_block(state, data, len, &offset, 1); | 525 | ret = si2165_upload_firmware_block(state, data, len, &offset, 1); |
@@ -538,7 +538,7 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
538 | ret = si2165_upload_firmware_block(state, data, len, | 538 | ret = si2165_upload_firmware_block(state, data, len, |
539 | &offset, block_count); | 539 | &offset, block_count); |
540 | if (ret < 0) { | 540 | if (ret < 0) { |
541 | dev_err(&state->i2c->dev, | 541 | dev_err(&state->client->dev, |
542 | "%s: firmware could not be uploaded\n", | 542 | "%s: firmware could not be uploaded\n", |
543 | KBUILD_MODNAME); | 543 | KBUILD_MODNAME); |
544 | goto error; | 544 | goto error; |
@@ -550,7 +550,7 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
550 | goto error; | 550 | goto error; |
551 | 551 | ||
552 | if (val16 != crc_expected) { | 552 | if (val16 != crc_expected) { |
553 | dev_err(&state->i2c->dev, | 553 | dev_err(&state->client->dev, |
554 | "%s: firmware crc mismatch %04x != %04x\n", | 554 | "%s: firmware crc mismatch %04x != %04x\n", |
555 | KBUILD_MODNAME, val16, crc_expected); | 555 | KBUILD_MODNAME, val16, crc_expected); |
556 | ret = -EINVAL; | 556 | ret = -EINVAL; |
@@ -562,7 +562,7 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
562 | goto error; | 562 | goto error; |
563 | 563 | ||
564 | if (len != offset) { | 564 | if (len != offset) { |
565 | dev_err(&state->i2c->dev, | 565 | dev_err(&state->client->dev, |
566 | "%s: firmware len mismatch %04x != %04x\n", | 566 | "%s: firmware len mismatch %04x != %04x\n", |
567 | KBUILD_MODNAME, len, offset); | 567 | KBUILD_MODNAME, len, offset); |
568 | ret = -EINVAL; | 568 | ret = -EINVAL; |
@@ -579,7 +579,7 @@ static int si2165_upload_firmware(struct si2165_state *state) | |||
579 | if (ret < 0) | 579 | if (ret < 0) |
580 | goto error; | 580 | goto error; |
581 | 581 | ||
582 | dev_info(&state->i2c->dev, "%s: fw load finished\n", KBUILD_MODNAME); | 582 | dev_info(&state->client->dev, "%s: fw load finished\n", KBUILD_MODNAME); |
583 | 583 | ||
584 | ret = 0; | 584 | ret = 0; |
585 | state->firmware_loaded = true; | 585 | state->firmware_loaded = true; |
@@ -613,7 +613,7 @@ static int si2165_init(struct dvb_frontend *fe) | |||
613 | if (ret < 0) | 613 | if (ret < 0) |
614 | goto error; | 614 | goto error; |
615 | if (val != state->config.chip_mode) { | 615 | if (val != state->config.chip_mode) { |
616 | dev_err(&state->i2c->dev, "%s: could not set chip_mode\n", | 616 | dev_err(&state->client->dev, "%s: could not set chip_mode\n", |
617 | KBUILD_MODNAME); | 617 | KBUILD_MODNAME); |
618 | return -EINVAL; | 618 | return -EINVAL; |
619 | } | 619 | } |
@@ -774,7 +774,7 @@ static int si2165_set_if_freq_shift(struct si2165_state *state) | |||
774 | u32 IF = 0; | 774 | u32 IF = 0; |
775 | 775 | ||
776 | if (!fe->ops.tuner_ops.get_if_frequency) { | 776 | if (!fe->ops.tuner_ops.get_if_frequency) { |
777 | dev_err(&state->i2c->dev, | 777 | dev_err(&state->client->dev, |
778 | "%s: Error: get_if_frequency() not defined at tuner. Can't work without it!\n", | 778 | "%s: Error: get_if_frequency() not defined at tuner. Can't work without it!\n", |
779 | KBUILD_MODNAME); | 779 | KBUILD_MODNAME); |
780 | return -EINVAL; | 780 | return -EINVAL; |
@@ -1076,7 +1076,7 @@ static int si2165_probe(struct i2c_client *client, | |||
1076 | 1076 | ||
1077 | if (state->config.ref_freq_Hz < 4000000 | 1077 | if (state->config.ref_freq_Hz < 4000000 |
1078 | || state->config.ref_freq_Hz > 27000000) { | 1078 | || state->config.ref_freq_Hz > 27000000) { |
1079 | dev_err(&state->i2c->dev, "%s: ref_freq of %d Hz not supported by this driver\n", | 1079 | dev_err(&state->client->dev, "%s: ref_freq of %d Hz not supported by this driver\n", |
1080 | KBUILD_MODNAME, state->config.ref_freq_Hz); | 1080 | KBUILD_MODNAME, state->config.ref_freq_Hz); |
1081 | ret = -EINVAL; | 1081 | ret = -EINVAL; |
1082 | goto error; | 1082 | goto error; |
@@ -1129,12 +1129,12 @@ static int si2165_probe(struct i2c_client *client, | |||
1129 | state->has_dvbc = true; | 1129 | state->has_dvbc = true; |
1130 | break; | 1130 | break; |
1131 | default: | 1131 | default: |
1132 | dev_err(&state->i2c->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n", | 1132 | dev_err(&state->client->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n", |
1133 | KBUILD_MODNAME, state->chip_type, state->chip_revcode); | 1133 | KBUILD_MODNAME, state->chip_type, state->chip_revcode); |
1134 | goto nodev_error; | 1134 | goto nodev_error; |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | dev_info(&state->i2c->dev, | 1137 | dev_info(&state->client->dev, |
1138 | "%s: Detected Silicon Labs %s-%c (type %d, rev %d)\n", | 1138 | "%s: Detected Silicon Labs %s-%c (type %d, rev %d)\n", |
1139 | KBUILD_MODNAME, chip_name, rev_char, state->chip_type, | 1139 | KBUILD_MODNAME, chip_name, rev_char, state->chip_type, |
1140 | state->chip_revcode); | 1140 | state->chip_revcode); |