diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-20 08:03:00 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 10:06:49 -0200 |
commit | b68d75b955a62a6ade9e004b656415f346c3ad40 (patch) | |
tree | 6d6348327b74153bce4f85ca0d1bead3ca063e15 /drivers/media/i2c | |
parent | a41231d52ff755597d67ce83bb36e16c47dfec91 (diff) |
[media] msp3400-driver: don't use KERN_CONT
Drivers using dev_foo() macro should not use KERN_CONT, as, internally,
those macros work as if all strings were terminated by a \n. So, doing:
dev_info(&client->dev, "%s ", client->name);
printk(KERN_CONT "supports radio, mode is autodetect and autoselect");
Would produce the following output:
msp3400 6-0044: msp3400
supports radio, mode is autodetect and autoselect
As there's no good reason to use KERN_CONT, let's rewrite the code
to avoid that, allowing this driver to be converted to dev_foo().
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/msp3400-driver.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 503b7c4f0a9b..ae396b965ef2 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -670,6 +670,13 @@ static const struct v4l2_subdev_ops msp_ops = { /* ----------------------------------------------------------------------- */ + +static const char * const opmode_str[] = { + [OPMODE_MANUAL] = "manual", + [OPMODE_AUTODETECT] = "autodetect", + [OPMODE_AUTOSELECT] = "autodetect and autoselect", +}; + static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct msp_state *state; @@ -791,7 +798,8 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) msp_family == 3 && msp_revision == 'G' && msp_prod_hi == 3; state->opmode = opmode; - if (state->opmode == OPMODE_AUTO) { + if (state->opmode < OPMODE_MANUAL + || state->opmode > OPMODE_AUTOSELECT) { /* MSP revision G and up have both autodetect and autoselect */ if (msp_revision >= 'G') state->opmode = OPMODE_AUTOSELECT; @@ -829,36 +837,28 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) v4l2_ctrl_cluster(2, &state->volume); v4l2_ctrl_handler_setup(hdl); - /* hello world :-) */ - v4l_info(client, "MSP%d4%02d%c-%c%d found @ 0x%x (%s)\n", - msp_family, msp_product, - msp_revision, msp_hard, msp_rom, - client->addr << 1, client->adapter->name); - v4l_info(client, "%s ", client->name); - if (state->has_nicam && state->has_radio) - printk(KERN_CONT "supports nicam and radio, "); - else if (state->has_nicam) - printk(KERN_CONT "supports nicam, "); - else if (state->has_radio) - printk(KERN_CONT "supports radio, "); - printk(KERN_CONT "mode is "); + dev_info(&client->dev, + "MSP%d4%02d%c-%c%d found on %s: supports %s%s%s, mode is %s\n", + msp_family, msp_product, + msp_revision, msp_hard, msp_rom, + client->adapter->name, + (state->has_nicam) ? "nicam" : "", + (state->has_nicam && state->has_radio) ? " and " : "", + (state->has_radio) ? "radio" : "", + opmode_str[state->opmode]); /* version-specific initialization */ switch (state->opmode) { case OPMODE_MANUAL: - printk(KERN_CONT "manual"); thread_func = msp3400c_thread; break; case OPMODE_AUTODETECT: - printk(KERN_CONT "autodetect"); thread_func = msp3410d_thread; break; case OPMODE_AUTOSELECT: - printk(KERN_CONT "autodetect and autoselect"); thread_func = msp34xxg_thread; break; } - printk(KERN_CONT "\n"); /* startup control thread if needed */ if (thread_func) { |