提交 bb92ea5e 编写于 作者: V Vivien Didelot 提交者: David S. Miller

net: dsa/mv88e6xxx: add reg read and write debug

This commit adds debug messages for the generic mv88e6xxx read and write
routines. The output is similar to this:

    mdio-gpio mdio-gpio.0: <- addr: 0x1b reg: 0x05 val: 0x4000
    mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x07 val: 0x3113
    mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x08 val: 0x0330
    mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x09 val: 0x0000

This is convenient to dynamically debug operations through debugfs with:

    echo file mv88e6xxx.c +p > <debugfs>/dynamic_debug/control
Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d23823dd
......@@ -85,6 +85,12 @@ int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg)
ret = __mv88e6xxx_reg_read(bus, ds->pd->sw_addr, addr, reg);
mutex_unlock(&ps->smi_mutex);
if (ret < 0)
return ret;
dev_dbg(ds->master_dev, "<- addr: 0x%.2x reg: 0x%.2x val: 0x%.4x\n",
addr, reg, ret);
return ret;
}
......@@ -128,6 +134,9 @@ int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
if (bus == NULL)
return -EINVAL;
dev_dbg(ds->master_dev, "-> addr: 0x%.2x reg: 0x%.2x val: 0x%.4x\n",
addr, reg, val);
mutex_lock(&ps->smi_mutex);
ret = __mv88e6xxx_reg_write(bus, ds->pd->sw_addr, addr, reg, val);
mutex_unlock(&ps->smi_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册