From bf0974e8dad414249d7cc44b7acc665658ca634a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 19 Sep 2012 10:57:38 +0000 Subject: switch: improve error message SVN-Revision: 33464 --- package/switch/src/switch-robo.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'package/switch') diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c index 656e69f..5b849cb 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; } } -- cgit v1.1