• Miquel Raynal's avatar
    phy: mvebu-cp110-comphy: fix port check in ->xlate() · ae4c5d69
    Miquel Raynal authored
    So far the PHY ->xlate() callback was checking if the port was
    "invalid" before continuing, meaning that the port has not been used
    yet. This check is not correct as there is no opposite call to
    ->xlate() once the PHY is released by the user and the port will
    remain "valid" after the first phy_get()/phy_put() calls. Hence, if
    this driver is built as a module, inserted, removed and inserted
    again, the PHY will appear busy and the second probe will fail.
    
    To fix this, just drop the faulty check and instead verify that the
    port number is valid (ie. in the possible range).
    Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
    ae4c5d69
phy-mvebu-cp110-comphy.c 23.2 KB