media: drxk: Use %*ph for printing hexdump of a small buffer
The kernel already has a helper to print a hexdump of a small buffer via pointer extension. Use that instead of open coded variant. In long term it helps to kill pr_cont() or at least narrow down its use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
906a6c1c45
commit
78e9ab0f74
|
@ -229,13 +229,8 @@ static int i2c_write(struct drxk_state *state, u8 adr, u8 *data, int len)
|
||||||
struct i2c_msg msg = {
|
struct i2c_msg msg = {
|
||||||
.addr = adr, .flags = 0, .buf = data, .len = len };
|
.addr = adr, .flags = 0, .buf = data, .len = len };
|
||||||
|
|
||||||
dprintk(3, ":");
|
dprintk(3, ": %*ph\n", len, data);
|
||||||
if (debug > 2) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
pr_cont(" %02x", data[i]);
|
|
||||||
pr_cont("\n");
|
|
||||||
}
|
|
||||||
status = drxk_i2c_transfer(state, &msg, 1);
|
status = drxk_i2c_transfer(state, &msg, 1);
|
||||||
if (status >= 0 && status != 1)
|
if (status >= 0 && status != 1)
|
||||||
status = -EIO;
|
status = -EIO;
|
||||||
|
@ -267,16 +262,7 @@ static int i2c_read(struct drxk_state *state,
|
||||||
pr_err("i2c read error at addr 0x%02x\n", adr);
|
pr_err("i2c read error at addr 0x%02x\n", adr);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
if (debug > 2) {
|
dprintk(3, ": read from %*ph, value = %*ph\n", len, msg, alen, answ);
|
||||||
int i;
|
|
||||||
dprintk(2, ": read from");
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
pr_cont(" %02x", msg[i]);
|
|
||||||
pr_cont(", value = ");
|
|
||||||
for (i = 0; i < alen; i++)
|
|
||||||
pr_cont(" %02x", answ[i]);
|
|
||||||
pr_cont("\n");
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,13 +427,8 @@ static int write_block(struct drxk_state *state, u32 address,
|
||||||
}
|
}
|
||||||
memcpy(&state->chunk[adr_length], p_block, chunk);
|
memcpy(&state->chunk[adr_length], p_block, chunk);
|
||||||
dprintk(2, "(0x%08x, 0x%02x)\n", address, flags);
|
dprintk(2, "(0x%08x, 0x%02x)\n", address, flags);
|
||||||
if (debug > 1) {
|
if (p_block)
|
||||||
int i;
|
dprintk(2, "%*ph\n", chunk, p_block);
|
||||||
if (p_block)
|
|
||||||
for (i = 0; i < chunk; i++)
|
|
||||||
pr_cont(" %02x", p_block[i]);
|
|
||||||
pr_cont("\n");
|
|
||||||
}
|
|
||||||
status = i2c_write(state, state->demod_address,
|
status = i2c_write(state, state->demod_address,
|
||||||
&state->chunk[0], chunk + adr_length);
|
&state->chunk[0], chunk + adr_length);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
|
|
Loading…
Reference in New Issue