mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
net: phy: simplify mdiobus_setup_mdiodev_from_board_info
- Move declaration of variable bi into list_for_each_entry_safe() - The return value of cb() effectively isn't used, this allows to simplify the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/f6bbe242-b43d-4c2b-8c51-2cb2cefbaf59@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
08207f42d3
commit
0893bf6bb4
@@ -26,24 +26,18 @@ void mdiobus_setup_mdiodev_from_board_info(struct mii_bus *bus,
|
||||
(struct mii_bus *bus,
|
||||
struct mdio_board_info *bi))
|
||||
{
|
||||
struct mdio_board_entry *be;
|
||||
struct mdio_board_entry *tmp;
|
||||
struct mdio_board_info *bi;
|
||||
int ret;
|
||||
struct mdio_board_entry *be, *tmp;
|
||||
|
||||
mutex_lock(&mdio_board_lock);
|
||||
list_for_each_entry_safe(be, tmp, &mdio_board_list, list) {
|
||||
bi = &be->board_info;
|
||||
struct mdio_board_info *bi = &be->board_info;
|
||||
|
||||
if (strcmp(bus->id, bi->bus_id))
|
||||
continue;
|
||||
|
||||
mutex_unlock(&mdio_board_lock);
|
||||
ret = cb(bus, bi);
|
||||
cb(bus, bi);
|
||||
mutex_lock(&mdio_board_lock);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
}
|
||||
mutex_unlock(&mdio_board_lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user