Skip to content

Commit 4ba1c5b

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: fixed_phy: constify status argument where possible
Constify the passed struct fixed_phy_status *status where possible. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d23b4af commit 4ba1c5b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

drivers/net/phy/fixed_phy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
131131
EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
132132

133133
static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
134-
struct fixed_phy_status *status,
134+
const struct fixed_phy_status *status,
135135
struct gpio_desc *gpiod)
136136
{
137137
int ret;
@@ -160,7 +160,7 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
160160
return 0;
161161
}
162162

163-
int fixed_phy_add(int phy_addr, struct fixed_phy_status *status)
163+
int fixed_phy_add(int phy_addr, const struct fixed_phy_status *status)
164164
{
165165
return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL);
166166
}
@@ -222,7 +222,7 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
222222
}
223223
#endif
224224

225-
struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
225+
struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
226226
struct device_node *np)
227227
{
228228
struct fixed_mdio_bus *fmb = &platform_fmb;

include/linux/phy_fixed.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ struct net_device;
1717

1818
#if IS_ENABLED(CONFIG_FIXED_PHY)
1919
extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
20-
int fixed_phy_add(int phy_id, struct fixed_phy_status *status);
21-
struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
20+
int fixed_phy_add(int phy_id, const struct fixed_phy_status *status);
21+
struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
2222
struct device_node *np);
2323

2424
extern void fixed_phy_unregister(struct phy_device *phydev);
@@ -27,12 +27,12 @@ extern int fixed_phy_set_link_update(struct phy_device *phydev,
2727
struct fixed_phy_status *));
2828
#else
2929
static inline int fixed_phy_add(int phy_id,
30-
struct fixed_phy_status *status)
30+
const struct fixed_phy_status *status)
3131
{
3232
return -ENODEV;
3333
}
3434
static inline struct phy_device *
35-
fixed_phy_register(struct fixed_phy_status *status,
35+
fixed_phy_register(const struct fixed_phy_status *status,
3636
struct device_node *np)
3737
{
3838
return ERR_PTR(-ENODEV);

0 commit comments

Comments
 (0)