diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2012-09-19 10:57:38 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2012-09-19 10:57:38 +0000 |
commit | 1e9116b36507d3087bf071bca1a225102a5e002e (patch) | |
tree | 85507b10af7cd6157c5dc343089a3038c4f68006 /package/switch | |
parent | c8aa973d09687dd6df8fc73ad0e83b5955d1f112 (diff) | |
download | upstream-1e9116b36507d3087bf071bca1a225102a5e002e.tar.gz upstream-1e9116b36507d3087bf071bca1a225102a5e002e.tar.bz2 upstream-1e9116b36507d3087bf071bca1a225102a5e002e.zip |
[package]: switch: improve error message
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33464 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/switch')
-rw-r--r-- | package/switch/src/switch-robo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c index 656e69ff12..5b849cb33d 100644 --- a/package/switch/src/switch-robo.c +++ b/package/switch/src/switch-robo.c @@ -96,12 +96,15 @@ static int do_ioctl(int cmd) static u16 mdio_read(__u16 phy_id, __u8 reg) { struct mii_ioctl_data *mii = if_mii(&robo.ifr); + int err; + mii->phy_id = phy_id; mii->reg_num = reg; - if (do_ioctl(SIOCGMIIREG) < 0) { + err = do_ioctl(SIOCGMIIREG); + if (err < 0) { printk(KERN_ERR PFX - "[%s:%d] SIOCGMIIREG failed!\n", __FILE__, __LINE__); + "[%s:%d] SIOCGMIIREG failed! err: %i\n", __FILE__, __LINE__, err); return 0xffff; } @@ -112,14 +115,16 @@ static u16 mdio_read(__u16 phy_id, __u8 reg) static void mdio_write(__u16 phy_id, __u8 reg, __u16 val) { struct mii_ioctl_data *mii = if_mii(&robo.ifr); + int err; mii->phy_id = phy_id; mii->reg_num = reg; mii->val_in = val; - if (do_ioctl(SIOCSMIIREG) < 0) { + err = do_ioctl(SIOCSMIIREG); + if (err < 0) { printk(KERN_ERR PFX - "[%s:%d] SIOCSMIIREG failed!\n", __FILE__, __LINE__); + "[%s:%d] SIOCSMIIREG failed! err: %i\n", __FILE__, __LINE__, err); return; } } |