struct i2c_msg msg = {
.addr = adr, .flags = 0, .buf = data, .len = len };
- dprintk(3, ":");
- if (debug > 2) {
- int i;
- for (i = 0; i < len; i++)
- pr_cont(" %02x", data[i]);
- pr_cont("\n");
- }
+ dprintk(3, ": %*ph\n", len, data);
+
status = drxk_i2c_transfer(state, &msg, 1);
if (status >= 0 && status != 1)
status = -EIO;
pr_err("i2c read error at addr 0x%02x\n", adr);
return status;
}
- if (debug > 2) {
- 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");
- }
+ dprintk(3, ": read from %*ph, value = %*ph\n", len, msg, alen, answ);
return 0;
}
}
memcpy(&state->chunk[adr_length], p_block, chunk);
dprintk(2, "(0x%08x, 0x%02x)\n", address, flags);
- if (debug > 1) {
- int i;
- if (p_block)
- for (i = 0; i < chunk; i++)
- pr_cont(" %02x", p_block[i]);
- pr_cont("\n");
- }
+ if (p_block)
+ dprintk(2, "%*ph\n", chunk, p_block);
status = i2c_write(state, state->demod_address,
&state->chunk[0], chunk + adr_length);
if (status < 0) {