Commit 37b4e43d authored by Olli Salonen's avatar Olli Salonen Committed by Mauro Carvalho Chehab

[media] si2168: clean logging

Same thing for si2168 as Antti did earlier for tda18212:

There is no need to print module name nor function name as those
are done by kernel logging system when dev_xxx logging is used and
driver is proper I2C driver.
Signed-off-by: default avatarOlli Salonen <olli.salonen@iki.fi>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent d102cac8
...@@ -55,8 +55,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd) ...@@ -55,8 +55,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd)
break; break;
} }
dev_dbg(&s->client->dev, "%s: cmd execution took %d ms\n", dev_dbg(&s->client->dev, "cmd execution took %d ms\n",
__func__,
jiffies_to_msecs(jiffies) - jiffies_to_msecs(jiffies) -
(jiffies_to_msecs(timeout) - TIMEOUT)); (jiffies_to_msecs(timeout) - TIMEOUT));
...@@ -75,7 +74,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd) ...@@ -75,7 +74,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd)
return 0; return 0;
err: err:
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&s->client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -150,12 +149,12 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -150,12 +149,12 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
} }
dev_dbg(&s->client->dev, "%s: status=%02x args=%*ph\n", dev_dbg(&s->client->dev, "status=%02x args=%*ph\n",
__func__, *status, cmd.rlen, cmd.args); *status, cmd.rlen, cmd.args);
return 0; return 0;
err: err:
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&s->client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -168,8 +167,8 @@ static int si2168_set_frontend(struct dvb_frontend *fe) ...@@ -168,8 +167,8 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
u8 bandwidth, delivery_system; u8 bandwidth, delivery_system;
dev_dbg(&s->client->dev, dev_dbg(&s->client->dev,
"%s: delivery_system=%u modulation=%u frequency=%u bandwidth_hz=%u symbol_rate=%u inversion=%u\n", "delivery_system=%u modulation=%u frequency=%u bandwidth_hz=%u symbol_rate=%u inversion=%u\n",
__func__, c->delivery_system, c->modulation, c->delivery_system, c->modulation,
c->frequency, c->bandwidth_hz, c->symbol_rate, c->frequency, c->bandwidth_hz, c->symbol_rate,
c->inversion); c->inversion);
...@@ -343,7 +342,7 @@ static int si2168_set_frontend(struct dvb_frontend *fe) ...@@ -343,7 +342,7 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
return 0; return 0;
err: err:
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&s->client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -357,7 +356,7 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -357,7 +356,7 @@ static int si2168_init(struct dvb_frontend *fe)
struct si2168_cmd cmd; struct si2168_cmd cmd;
unsigned int chip_id; unsigned int chip_id;
dev_dbg(&s->client->dev, "%s:\n", __func__); dev_dbg(&s->client->dev, "\n");
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13); memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
cmd.wlen = 13; cmd.wlen = 13;
...@@ -400,16 +399,16 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -400,16 +399,16 @@ static int si2168_init(struct dvb_frontend *fe)
break; break;
default: default:
dev_err(&s->client->dev, dev_err(&s->client->dev,
"%s: unkown chip version Si21%d-%c%c%c\n", "unknown chip version Si21%d-%c%c%c\n",
KBUILD_MODNAME, cmd.args[2], cmd.args[1], cmd.args[2], cmd.args[1],
cmd.args[3], cmd.args[4]); cmd.args[3], cmd.args[4]);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
/* cold state - try to download firmware */ /* cold state - try to download firmware */
dev_info(&s->client->dev, "%s: found a '%s' in cold state\n", dev_info(&s->client->dev, "found a '%s' in cold state\n",
KBUILD_MODNAME, si2168_ops.info.name); si2168_ops.info.name);
/* request the firmware, this will block and timeout */ /* request the firmware, this will block and timeout */
ret = request_firmware(&fw, fw_file, &s->client->dev); ret = request_firmware(&fw, fw_file, &s->client->dev);
...@@ -422,18 +421,18 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -422,18 +421,18 @@ static int si2168_init(struct dvb_frontend *fe)
if (ret == 0) { if (ret == 0) {
dev_notice(&s->client->dev, dev_notice(&s->client->dev,
"%s: please install firmware file '%s'\n", "please install firmware file '%s'\n",
KBUILD_MODNAME, SI2168_B40_FIRMWARE); SI2168_B40_FIRMWARE);
} else { } else {
dev_err(&s->client->dev, dev_err(&s->client->dev,
"%s: firmware file '%s' not found\n", "firmware file '%s' not found\n",
KBUILD_MODNAME, fw_file); fw_file);
goto err; goto err;
} }
} }
dev_info(&s->client->dev, "%s: downloading firmware from file '%s'\n", dev_info(&s->client->dev, "downloading firmware from file '%s'\n",
KBUILD_MODNAME, fw_file); fw_file);
for (remaining = fw->size; remaining > 0; remaining -= i2c_wr_max) { for (remaining = fw->size; remaining > 0; remaining -= i2c_wr_max) {
len = remaining; len = remaining;
...@@ -446,8 +445,8 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -446,8 +445,8 @@ static int si2168_init(struct dvb_frontend *fe)
ret = si2168_cmd_execute(s, &cmd); ret = si2168_cmd_execute(s, &cmd);
if (ret) { if (ret) {
dev_err(&s->client->dev, dev_err(&s->client->dev,
"%s: firmware download failed=%d\n", "firmware download failed=%d\n",
KBUILD_MODNAME, ret); ret);
goto err; goto err;
} }
} }
...@@ -462,8 +461,8 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -462,8 +461,8 @@ static int si2168_init(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
dev_info(&s->client->dev, "%s: found a '%s' in warm state\n", dev_info(&s->client->dev, "found a '%s' in warm state\n",
KBUILD_MODNAME, si2168_ops.info.name); si2168_ops.info.name);
s->active = true; s->active = true;
...@@ -472,7 +471,7 @@ static int si2168_init(struct dvb_frontend *fe) ...@@ -472,7 +471,7 @@ static int si2168_init(struct dvb_frontend *fe)
if (fw) if (fw)
release_firmware(fw); release_firmware(fw);
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&s->client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -482,7 +481,7 @@ static int si2168_sleep(struct dvb_frontend *fe) ...@@ -482,7 +481,7 @@ static int si2168_sleep(struct dvb_frontend *fe)
int ret; int ret;
struct si2168_cmd cmd; struct si2168_cmd cmd;
dev_dbg(&s->client->dev, "%s:\n", __func__); dev_dbg(&s->client->dev, "\n");
s->active = false; s->active = false;
...@@ -495,7 +494,7 @@ static int si2168_sleep(struct dvb_frontend *fe) ...@@ -495,7 +494,7 @@ static int si2168_sleep(struct dvb_frontend *fe)
return 0; return 0;
err: err:
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&s->client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -528,8 +527,7 @@ static int si2168_select(struct i2c_adapter *adap, void *mux_priv, u32 chan) ...@@ -528,8 +527,7 @@ static int si2168_select(struct i2c_adapter *adap, void *mux_priv, u32 chan)
/* open tuner I2C gate */ /* open tuner I2C gate */
ret = __i2c_transfer(s->client->adapter, &gate_open_msg, 1); ret = __i2c_transfer(s->client->adapter, &gate_open_msg, 1);
if (ret != 1) { if (ret != 1) {
dev_warn(&s->client->dev, "%s: i2c write failed=%d\n", dev_warn(&s->client->dev, "i2c write failed=%d\n", ret);
KBUILD_MODNAME, ret);
if (ret >= 0) if (ret >= 0)
ret = -EREMOTEIO; ret = -EREMOTEIO;
} else { } else {
...@@ -553,8 +551,7 @@ static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan) ...@@ -553,8 +551,7 @@ static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan)
/* close tuner I2C gate */ /* close tuner I2C gate */
ret = __i2c_transfer(s->client->adapter, &gate_close_msg, 1); ret = __i2c_transfer(s->client->adapter, &gate_close_msg, 1);
if (ret != 1) { if (ret != 1) {
dev_warn(&s->client->dev, "%s: i2c write failed=%d\n", dev_warn(&s->client->dev, "i2c write failed=%d\n", ret);
KBUILD_MODNAME, ret);
if (ret >= 0) if (ret >= 0)
ret = -EREMOTEIO; ret = -EREMOTEIO;
} else { } else {
...@@ -607,12 +604,12 @@ static int si2168_probe(struct i2c_client *client, ...@@ -607,12 +604,12 @@ static int si2168_probe(struct i2c_client *client,
struct si2168 *s; struct si2168 *s;
int ret; int ret;
dev_dbg(&client->dev, "%s:\n", __func__); dev_dbg(&client->dev, "\n");
s = kzalloc(sizeof(struct si2168), GFP_KERNEL); s = kzalloc(sizeof(struct si2168), GFP_KERNEL);
if (!s) { if (!s) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(&client->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME); dev_err(&client->dev, "kzalloc() failed\n");
goto err; goto err;
} }
...@@ -637,12 +634,11 @@ static int si2168_probe(struct i2c_client *client, ...@@ -637,12 +634,11 @@ static int si2168_probe(struct i2c_client *client,
i2c_set_clientdata(client, s); i2c_set_clientdata(client, s);
dev_info(&s->client->dev, dev_info(&s->client->dev,
"%s: Silicon Labs Si2168 successfully attached\n", "Silicon Labs Si2168 successfully attached\n");
KBUILD_MODNAME);
return 0; return 0;
err: err:
kfree(s); kfree(s);
dev_dbg(&client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -650,7 +646,7 @@ static int si2168_remove(struct i2c_client *client) ...@@ -650,7 +646,7 @@ static int si2168_remove(struct i2c_client *client)
{ {
struct si2168 *s = i2c_get_clientdata(client); struct si2168 *s = i2c_get_clientdata(client);
dev_dbg(&client->dev, "%s:\n", __func__); dev_dbg(&client->dev, "\n");
i2c_del_mux_adapter(s->adapter); i2c_del_mux_adapter(s->adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment