@@ -230,14 +230,14 @@ static int phy_mc_vsc8541_get_speed(const struct device *dev, struct phy_link_st
230
230
return ret ;
231
231
}
232
232
233
- is_duplex = (aux_status & PHY_REG_PAGE0_EXT_DEV_AUX_DUPLEX ) != 0 ;
233
+ is_duplex = (aux_status & PHY_REG_PAGE0_EXT_DEV_AUX_DUPLEX ) != 0U ;
234
234
235
235
ret = phy_mc_vsc8541_read (dev , PHY_REG_PAGE0_STAT1000_EXT2 , & link1000_status );
236
236
if (ret < 0 ) {
237
237
return ret ;
238
238
}
239
239
240
- if ((link1000_status & BIT (12 ))) {
240
+ if ((link1000_status & BIT (12 )) != 0U ) {
241
241
state -> speed = is_duplex ? LINK_FULL_1000BASE : LINK_HALF_1000BASE ;
242
242
return 0 ; /* no need to check lower speeds */
243
243
}
@@ -247,7 +247,7 @@ static int phy_mc_vsc8541_get_speed(const struct device *dev, struct phy_link_st
247
247
return ret ;
248
248
}
249
249
250
- if (link100_status & BIT (12 )) {
250
+ if (( link100_status & BIT (12 )) != 0U ) {
251
251
state -> speed = is_duplex ? LINK_FULL_100BASE : LINK_HALF_100BASE ;
252
252
return 0 ; /* no need to check lower speeds */
253
253
}
@@ -257,7 +257,7 @@ static int phy_mc_vsc8541_get_speed(const struct device *dev, struct phy_link_st
257
257
return ret ;
258
258
}
259
259
260
- if (link10_status & BIT (6 )) {
260
+ if (( link10_status & BIT (6 )) != 0U ) {
261
261
state -> speed = is_duplex ? LINK_FULL_10BASE : LINK_HALF_10BASE ;
262
262
} else {
263
263
state -> speed = 0 ; /* no link */
@@ -269,7 +269,7 @@ static int phy_mc_vsc8541_get_speed(const struct device *dev, struct phy_link_st
269
269
static int phy_mc_vsc8541_cfg_link (const struct device * dev , enum phy_link_speed adv_speeds ,
270
270
enum phy_cfg_link_flag flags )
271
271
{
272
- if (flags & PHY_FLAG_AUTO_NEGOTIATION_DISABLED ) {
272
+ if (( flags & PHY_FLAG_AUTO_NEGOTIATION_DISABLED ) != 0U ) {
273
273
LOG_ERR ("Disabling auto-negotiation is not supported by this driver" );
274
274
return - ENOTSUP ;
275
275
}
@@ -284,7 +284,6 @@ static int phy_mc_vsc8541_cfg_link(const struct device *dev, enum phy_link_speed
284
284
static int phy_mc_vsc8541_init (const struct device * dev )
285
285
{
286
286
struct mc_vsc8541_data * data = dev -> data ;
287
- struct mc_vsc8541_config * cfg = dev -> config ;
288
287
int ret ;
289
288
290
289
data -> active_page = -1 ;
@@ -335,7 +334,7 @@ static int phy_mc_vsc8541_get_link(const struct device *dev, struct phy_link_sta
335
334
336
335
hasLink = (reg_sr & MII_BMSR_LINK_STATUS ) != 0 ;
337
336
338
- if (reg_cr & MII_BMCR_AUTONEG_ENABLE ) {
337
+ if (( reg_cr & MII_BMCR_AUTONEG_ENABLE ) != 0U ) {
339
338
/* auto negotiation active; update status */
340
339
auto_negotiation_finished = (reg_sr & MII_BMSR_AUTONEG_COMPLETE ) != 0 ;
341
340
}
@@ -489,6 +488,7 @@ static int phy_mc_vsc8541_write(const struct device *dev, uint16_t reg_addr, uin
489
488
490
489
static DEVICE_API (ethphy , mc_vsc8541_phy_api ) = {
491
490
.get_link = phy_mc_vsc8541_get_link ,
491
+ .cfg_link = phy_mc_vsc8541_cfg_link ,
492
492
.link_cb_set = phy_mc_vsc8541_link_cb_set ,
493
493
.read = phy_mc_vsc8541_read ,
494
494
.write = phy_mc_vsc8541_write ,
0 commit comments