realtek: mdio: convert to consistent a_to_b() helpers
Majority of kernel uses a_to_b(a) instead of b_from_a(a). Convert to that to be consistent with all helpers in the driver. Additionally drop inline function definitions. Let the compiler decide what is best. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/23411 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
57dbfa0a9c
commit
b8fc512a05
@ -269,7 +269,7 @@ struct rtmd_phy_info {
|
|||||||
unsigned int poll_lpa_1000;
|
unsigned int poll_lpa_1000;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct rtmd_ctrl *rtmd_ctrl_from_bus(struct mii_bus *bus)
|
static struct rtmd_ctrl *rtmd_bus_to_ctrl(struct mii_bus *bus)
|
||||||
{
|
{
|
||||||
return ((struct rtmd_chan *)bus->priv)->ctrl;
|
return ((struct rtmd_chan *)bus->priv)->ctrl;
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ static int rtmd_phy_to_port(struct mii_bus *bus, int phy)
|
|||||||
static int rtmd_run_cmd(struct mii_bus *bus, u32 cmd,
|
static int rtmd_run_cmd(struct mii_bus *bus, u32 cmd,
|
||||||
struct rtmd_command_data *cmd_data, u32 *val)
|
struct rtmd_command_data *cmd_data, u32 *val)
|
||||||
{
|
{
|
||||||
struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus);
|
struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus);
|
||||||
u32 cmdstate;
|
u32 cmdstate;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ static int rtmd_931x_write_c45(struct mii_bus *bus, u32 pn, u32 devnum, u32 regn
|
|||||||
|
|
||||||
static int rtmd_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum)
|
static int rtmd_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum)
|
||||||
{
|
{
|
||||||
struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus);
|
struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus);
|
||||||
int ret, pn, val = 0;
|
int ret, pn, val = 0;
|
||||||
|
|
||||||
pn = rtmd_phy_to_port(bus, phy);
|
pn = rtmd_phy_to_port(bus, phy);
|
||||||
@ -539,7 +539,7 @@ static int rtmd_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum)
|
|||||||
|
|
||||||
static int rtmd_read_c22(struct mii_bus *bus, int phy, int regnum)
|
static int rtmd_read_c22(struct mii_bus *bus, int phy, int regnum)
|
||||||
{
|
{
|
||||||
struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus);
|
struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus);
|
||||||
int ret, pn, val = 0;
|
int ret, pn, val = 0;
|
||||||
|
|
||||||
pn = rtmd_phy_to_port(bus, phy);
|
pn = rtmd_phy_to_port(bus, phy);
|
||||||
@ -562,7 +562,7 @@ static int rtmd_read_c22(struct mii_bus *bus, int phy, int regnum)
|
|||||||
|
|
||||||
static int rtmd_write_c45(struct mii_bus *bus, int phy, int devnum, int regnum, u16 val)
|
static int rtmd_write_c45(struct mii_bus *bus, int phy, int devnum, int regnum, u16 val)
|
||||||
{
|
{
|
||||||
struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus);
|
struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus);
|
||||||
int ret, pn;
|
int ret, pn;
|
||||||
|
|
||||||
pn = rtmd_phy_to_port(bus, phy);
|
pn = rtmd_phy_to_port(bus, phy);
|
||||||
@ -579,7 +579,7 @@ static int rtmd_write_c45(struct mii_bus *bus, int phy, int devnum, int regnum,
|
|||||||
|
|
||||||
static int rtmd_write_c22(struct mii_bus *bus, int phy, int regnum, u16 val)
|
static int rtmd_write_c22(struct mii_bus *bus, int phy, int regnum, u16 val)
|
||||||
{
|
{
|
||||||
struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus);
|
struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus);
|
||||||
int ret, page, pn;
|
int ret, page, pn;
|
||||||
|
|
||||||
pn = rtmd_phy_to_port(bus, phy);
|
pn = rtmd_phy_to_port(bus, phy);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user