On Wed, Dec 03, 2014 at 06:34:02PM +0400, Alexander Kochetkov wrote:
> Signed-off-by: Alexander Kochetkov <[email protected]>
> ---
>  drivers/i2c/busses/i2c-omap.c |   45 
> ++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 42 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 66506db..d2dfabe 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -283,6 +283,23 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev 
> *i2c_dev, int reg)
>                               (i2c_dev->regs[reg] << i2c_dev->reg_shift));
>  }
>  
> +#ifdef dev_dbg
> +#undef dev_dbg
> +#endif
> +#define dev_dbg dev_info
> +
> +static inline void omap_i2c_dump_state(const char *func, int line,
> +     struct omap_i2c_dev *dev, const char *msg)
> +{
> +     dev_dbg(dev->dev, "%s: STAT=0x%04x; IE=0x%04x; CON=0x%04x; (%s:%d)\n",
> +             msg,
> +             omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG),
> +             omap_i2c_read_reg(dev, OMAP_I2C_IE_REG),
> +             omap_i2c_read_reg(dev, OMAP_I2C_CON_REG),
> +             func, line);
> +}
> +#define OMAP_I2C_DUMP_STATE(dev, msg) omap_i2c_dump_state(__func__, 
> __LINE__, (dev), (msg))

NAK, if you want to add traces, use, well, tracepoints :-) It makes no
sense to hack stuff like this.

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to