mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-17 23:35:00 +02:00
[package]: switch: improve error message
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33464 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
49bdd0278a
commit
e8793f4a3f
@ -96,12 +96,15 @@ static int do_ioctl(int cmd)
|
|||||||
static u16 mdio_read(__u16 phy_id, __u8 reg)
|
static u16 mdio_read(__u16 phy_id, __u8 reg)
|
||||||
{
|
{
|
||||||
struct mii_ioctl_data *mii = if_mii(&robo.ifr);
|
struct mii_ioctl_data *mii = if_mii(&robo.ifr);
|
||||||
|
int err;
|
||||||
|
|
||||||
mii->phy_id = phy_id;
|
mii->phy_id = phy_id;
|
||||||
mii->reg_num = reg;
|
mii->reg_num = reg;
|
||||||
|
|
||||||
if (do_ioctl(SIOCGMIIREG) < 0) {
|
err = do_ioctl(SIOCGMIIREG);
|
||||||
|
if (err < 0) {
|
||||||
printk(KERN_ERR PFX
|
printk(KERN_ERR PFX
|
||||||
"[%s:%d] SIOCGMIIREG failed!\n", __FILE__, __LINE__);
|
"[%s:%d] SIOCGMIIREG failed! err: %i\n", __FILE__, __LINE__, err);
|
||||||
|
|
||||||
return 0xffff;
|
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)
|
static void mdio_write(__u16 phy_id, __u8 reg, __u16 val)
|
||||||
{
|
{
|
||||||
struct mii_ioctl_data *mii = if_mii(&robo.ifr);
|
struct mii_ioctl_data *mii = if_mii(&robo.ifr);
|
||||||
|
int err;
|
||||||
|
|
||||||
mii->phy_id = phy_id;
|
mii->phy_id = phy_id;
|
||||||
mii->reg_num = reg;
|
mii->reg_num = reg;
|
||||||
mii->val_in = val;
|
mii->val_in = val;
|
||||||
|
|
||||||
if (do_ioctl(SIOCSMIIREG) < 0) {
|
err = do_ioctl(SIOCSMIIREG);
|
||||||
|
if (err < 0) {
|
||||||
printk(KERN_ERR PFX
|
printk(KERN_ERR PFX
|
||||||
"[%s:%d] SIOCSMIIREG failed!\n", __FILE__, __LINE__);
|
"[%s:%d] SIOCSMIIREG failed! err: %i\n", __FILE__, __LINE__, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user