Commit 45626201 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] fc0012: use Kernel dev_foo() logging

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Acked-by: default avatarHans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 44ff69cd
...@@ -21,15 +21,6 @@ ...@@ -21,15 +21,6 @@
#ifndef _FC0012_PRIV_H_ #ifndef _FC0012_PRIV_H_
#define _FC0012_PRIV_H_ #define _FC0012_PRIV_H_
#define LOG_PREFIX "fc0012"
#undef err
#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
#undef info
#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef warn
#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)
struct fc0012_priv { struct fc0012_priv {
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
const struct fc0012_config *cfg; const struct fc0012_config *cfg;
......
...@@ -29,7 +29,9 @@ static int fc0012_writereg(struct fc0012_priv *priv, u8 reg, u8 val) ...@@ -29,7 +29,9 @@ static int fc0012_writereg(struct fc0012_priv *priv, u8 reg, u8 val)
}; };
if (i2c_transfer(priv->i2c, &msg, 1) != 1) { if (i2c_transfer(priv->i2c, &msg, 1) != 1) {
err("I2C write reg failed, reg: %02x, val: %02x", reg, val); dev_err(&priv->i2c->dev,
"%s: I2C write reg failed, reg: %02x, val: %02x\n",
KBUILD_MODNAME, reg, val);
return -EREMOTEIO; return -EREMOTEIO;
} }
return 0; return 0;
...@@ -45,7 +47,9 @@ static int fc0012_readreg(struct fc0012_priv *priv, u8 reg, u8 *val) ...@@ -45,7 +47,9 @@ static int fc0012_readreg(struct fc0012_priv *priv, u8 reg, u8 *val)
}; };
if (i2c_transfer(priv->i2c, msg, 2) != 2) { if (i2c_transfer(priv->i2c, msg, 2) != 2) {
err("I2C read reg failed, reg: %02x", reg); dev_err(&priv->i2c->dev,
"%s: I2C read reg failed, reg: %02x\n",
KBUILD_MODNAME, reg);
return -EREMOTEIO; return -EREMOTEIO;
} }
return 0; return 0;
...@@ -119,7 +123,8 @@ static int fc0012_init(struct dvb_frontend *fe) ...@@ -119,7 +123,8 @@ static int fc0012_init(struct dvb_frontend *fe)
fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
if (ret) if (ret)
err("fc0012_writereg failed: %d", ret); dev_err(&priv->i2c->dev, "%s: fc0012_writereg failed: %d\n",
KBUILD_MODNAME, ret);
return ret; return ret;
} }
...@@ -261,7 +266,8 @@ static int fc0012_set_params(struct dvb_frontend *fe) ...@@ -261,7 +266,8 @@ static int fc0012_set_params(struct dvb_frontend *fe)
break; break;
} }
} else { } else {
err("%s: modulation type not supported!", __func__); dev_err(&priv->i2c->dev, "%s: modulation type not supported!\n",
KBUILD_MODNAME);
return -EINVAL; return -EINVAL;
} }
...@@ -323,7 +329,8 @@ static int fc0012_set_params(struct dvb_frontend *fe) ...@@ -323,7 +329,8 @@ static int fc0012_set_params(struct dvb_frontend *fe)
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
if (ret) if (ret)
warn("%s: failed: %d", __func__, ret); dev_warn(&priv->i2c->dev, "%s: %s failed: %d\n",
KBUILD_MODNAME, __func__, ret);
return ret; return ret;
} }
...@@ -413,7 +420,8 @@ static int fc0012_get_rf_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -413,7 +420,8 @@ static int fc0012_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
exit: exit:
if (ret) if (ret)
warn("%s: failed: %d", __func__, ret); dev_warn(&priv->i2c->dev, "%s: %s failed: %d\n",
KBUILD_MODNAME, __func__, ret);
return ret; return ret;
} }
......
...@@ -58,7 +58,7 @@ static inline struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, ...@@ -58,7 +58,7 @@ static inline struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c, struct i2c_adapter *i2c,
const struct fc0012_config *cfg) const struct fc0012_config *cfg)
{ {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL; return NULL;
} }
#endif #endif
......
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