net: ethernet: ixgbe: don't call devm_mdiobus_free()
The idea behind devres is that the release callbacks are called if probe fails. As we now check the return value of ixgbe_mii_bus_init(), we can drop the call devm_mdiobus_free() in error path as the release callback will be called automatically. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
09ef193fef
commit
d10d607f50
@@ -905,7 +905,6 @@ s32 ixgbe_mii_bus_init(struct ixgbe_hw *hw)
|
|||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
struct device *dev = &adapter->netdev->dev;
|
struct device *dev = &adapter->netdev->dev;
|
||||||
struct mii_bus *bus;
|
struct mii_bus *bus;
|
||||||
int err = -ENODEV;
|
|
||||||
|
|
||||||
bus = devm_mdiobus_alloc(dev);
|
bus = devm_mdiobus_alloc(dev);
|
||||||
if (!bus)
|
if (!bus)
|
||||||
@@ -923,7 +922,7 @@ s32 ixgbe_mii_bus_init(struct ixgbe_hw *hw)
|
|||||||
case IXGBE_DEV_ID_X550EM_A_1G_T:
|
case IXGBE_DEV_ID_X550EM_A_1G_T:
|
||||||
case IXGBE_DEV_ID_X550EM_A_1G_T_L:
|
case IXGBE_DEV_ID_X550EM_A_1G_T_L:
|
||||||
if (!ixgbe_x550em_a_has_mii(hw))
|
if (!ixgbe_x550em_a_has_mii(hw))
|
||||||
goto ixgbe_no_mii_bus;
|
return -ENODEV;
|
||||||
bus->read = &ixgbe_x550em_a_mii_bus_read;
|
bus->read = &ixgbe_x550em_a_mii_bus_read;
|
||||||
bus->write = &ixgbe_x550em_a_mii_bus_write;
|
bus->write = &ixgbe_x550em_a_mii_bus_write;
|
||||||
break;
|
break;
|
||||||
@@ -948,15 +947,8 @@ s32 ixgbe_mii_bus_init(struct ixgbe_hw *hw)
|
|||||||
*/
|
*/
|
||||||
hw->phy.mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22;
|
hw->phy.mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22;
|
||||||
|
|
||||||
err = mdiobus_register(bus);
|
adapter->mii_bus = bus;
|
||||||
if (!err) {
|
return mdiobus_register(bus);
|
||||||
adapter->mii_bus = bus;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ixgbe_no_mii_bus:
|
|
||||||
devm_mdiobus_free(dev, bus);
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user