diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2015-01-23 16:10:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-27 03:04:02 -0500 |
commit | bb92ea5e352db0674dec77491ad44d81d7d9b2e2 (patch) | |
tree | ae00ed9a632cf270faad4f20f9a066d25648fddb /drivers/net/dsa | |
parent | d23823dd61516b279f75356a34b5b93397bc33b0 (diff) |
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: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index cd6807c6b4ed..3e7e31a6abb7 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -85,6 +85,12 @@ int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg) | |||
85 | ret = __mv88e6xxx_reg_read(bus, ds->pd->sw_addr, addr, reg); | 85 | ret = __mv88e6xxx_reg_read(bus, ds->pd->sw_addr, addr, reg); |
86 | mutex_unlock(&ps->smi_mutex); | 86 | mutex_unlock(&ps->smi_mutex); |
87 | 87 | ||
88 | if (ret < 0) | ||
89 | return ret; | ||
90 | |||
91 | dev_dbg(ds->master_dev, "<- addr: 0x%.2x reg: 0x%.2x val: 0x%.4x\n", | ||
92 | addr, reg, ret); | ||
93 | |||
88 | return ret; | 94 | return ret; |
89 | } | 95 | } |
90 | 96 | ||
@@ -128,6 +134,9 @@ int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) | |||
128 | if (bus == NULL) | 134 | if (bus == NULL) |
129 | return -EINVAL; | 135 | return -EINVAL; |
130 | 136 | ||
137 | dev_dbg(ds->master_dev, "-> addr: 0x%.2x reg: 0x%.2x val: 0x%.4x\n", | ||
138 | addr, reg, val); | ||
139 | |||
131 | mutex_lock(&ps->smi_mutex); | 140 | mutex_lock(&ps->smi_mutex); |
132 | ret = __mv88e6xxx_reg_write(bus, ds->pd->sw_addr, addr, reg, val); | 141 | ret = __mv88e6xxx_reg_write(bus, ds->pd->sw_addr, addr, reg, val); |
133 | mutex_unlock(&ps->smi_mutex); | 142 | mutex_unlock(&ps->smi_mutex); |