Commit 67d0113a authored by Olli Salonen's avatar Olli Salonen Committed by Mauro Carvalho Chehab

[media] si2157: clean logging

Same thing for si2157 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.

While here, fix a typo ("unknown") in si2157_init.
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 37b4e43d
...@@ -55,8 +55,7 @@ static int si2157_cmd_execute(struct si2157 *s, struct si2157_cmd *cmd) ...@@ -55,8 +55,7 @@ static int si2157_cmd_execute(struct si2157 *s, struct si2157_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 si2157_cmd_execute(struct si2157 *s, struct si2157_cmd *cmd) ...@@ -75,7 +74,7 @@ static int si2157_cmd_execute(struct si2157 *s, struct si2157_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;
} }
...@@ -88,7 +87,7 @@ static int si2157_init(struct dvb_frontend *fe) ...@@ -88,7 +87,7 @@ static int si2157_init(struct dvb_frontend *fe)
u8 *fw_file; u8 *fw_file;
unsigned int chip_id; unsigned int chip_id;
dev_dbg(&s->client->dev, "%s:\n", __func__); dev_dbg(&s->client->dev, "\n");
/* configure? */ /* configure? */
memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15); memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
...@@ -121,35 +120,35 @@ static int si2157_init(struct dvb_frontend *fe) ...@@ -121,35 +120,35 @@ static int si2157_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, si2157_ops.info.name); si2157_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);
if (ret) { if (ret) {
dev_err(&s->client->dev, "%s: firmware file '%s' not found\n", dev_err(&s->client->dev, "firmware file '%s' not found\n",
KBUILD_MODNAME, fw_file); fw_file);
goto err; goto err;
} }
/* firmware should be n chunks of 17 bytes */ /* firmware should be n chunks of 17 bytes */
if (fw->size % 17 != 0) { if (fw->size % 17 != 0) {
dev_err(&s->client->dev, "%s: firmware file '%s' is invalid\n", dev_err(&s->client->dev, "firmware file '%s' is invalid\n",
KBUILD_MODNAME, fw_file); fw_file);
ret = -EINVAL; ret = -EINVAL;
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 -= 17) { for (remaining = fw->size; remaining > 0; remaining -= 17) {
len = fw->data[fw->size - remaining]; len = fw->data[fw->size - remaining];
...@@ -159,8 +158,8 @@ static int si2157_init(struct dvb_frontend *fe) ...@@ -159,8 +158,8 @@ static int si2157_init(struct dvb_frontend *fe)
ret = si2157_cmd_execute(s, &cmd); ret = si2157_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;
} }
} }
...@@ -184,7 +183,7 @@ static int si2157_init(struct dvb_frontend *fe) ...@@ -184,7 +183,7 @@ static int si2157_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;
} }
...@@ -194,7 +193,7 @@ static int si2157_sleep(struct dvb_frontend *fe) ...@@ -194,7 +193,7 @@ static int si2157_sleep(struct dvb_frontend *fe)
int ret; int ret;
struct si2157_cmd cmd; struct si2157_cmd cmd;
dev_dbg(&s->client->dev, "%s:\n", __func__); dev_dbg(&s->client->dev, "\n");
s->active = false; s->active = false;
...@@ -207,7 +206,7 @@ static int si2157_sleep(struct dvb_frontend *fe) ...@@ -207,7 +206,7 @@ static int si2157_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;
} }
...@@ -220,8 +219,8 @@ static int si2157_set_params(struct dvb_frontend *fe) ...@@ -220,8 +219,8 @@ static int si2157_set_params(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=%d frequency=%u bandwidth_hz=%u\n", "delivery_system=%d frequency=%u bandwidth_hz=%u\n",
__func__, c->delivery_system, c->frequency, c->delivery_system, c->frequency,
c->bandwidth_hz); c->bandwidth_hz);
if (!s->active) { if (!s->active) {
...@@ -275,7 +274,7 @@ static int si2157_set_params(struct dvb_frontend *fe) ...@@ -275,7 +274,7 @@ static int si2157_set_params(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;
} }
...@@ -310,7 +309,7 @@ static int si2157_probe(struct i2c_client *client, ...@@ -310,7 +309,7 @@ static int si2157_probe(struct i2c_client *client,
s = kzalloc(sizeof(struct si2157), GFP_KERNEL); s = kzalloc(sizeof(struct si2157), 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;
} }
...@@ -333,11 +332,10 @@ static int si2157_probe(struct i2c_client *client, ...@@ -333,11 +332,10 @@ static int si2157_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 Si2157/Si2158 successfully attached\n", "Silicon Labs Si2157/Si2158 successfully attached\n");
KBUILD_MODNAME);
return 0; return 0;
err: err:
dev_dbg(&client->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&client->dev, "failed=%d\n", ret);
kfree(s); kfree(s);
return ret; return ret;
...@@ -348,7 +346,7 @@ static int si2157_remove(struct i2c_client *client) ...@@ -348,7 +346,7 @@ static int si2157_remove(struct i2c_client *client)
struct si2157 *s = i2c_get_clientdata(client); struct si2157 *s = i2c_get_clientdata(client);
struct dvb_frontend *fe = s->fe; struct dvb_frontend *fe = s->fe;
dev_dbg(&client->dev, "%s:\n", __func__); dev_dbg(&client->dev, "\n");
memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops));
fe->tuner_priv = NULL; fe->tuner_priv = NULL;
......
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