Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-dsa-microchip-small-cleanups-for-ksz9477-sgmii'

Maxime Chevallier says:

====================
net: dsa: microchip: Small cleanups for ksz9477 SGMII

While working with ksz9477, I've done some very minor cleanups around the
PCS code for the SGMII port. No changes intended.
====================

Link: https://patch.msgid.link/20260324180826.524327-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+24 -27
+24 -27
drivers/net/dsa/microchip/ksz9477.c
··· 310 310 311 311 int ksz9477_pcs_create(struct ksz_device *dev) 312 312 { 313 - /* This chip has a SGMII port. */ 314 - if (ksz_has_sgmii_port(dev)) { 315 - int port = ksz_get_sgmii_port(dev); 316 - struct ksz_port *p = &dev->ports[port]; 317 - struct phylink_pcs *pcs; 318 - struct mii_bus *bus; 319 - int ret; 313 + int port = ksz_get_sgmii_port(dev); 314 + struct ksz_port *p = &dev->ports[port]; 315 + struct phylink_pcs *pcs; 316 + struct mii_bus *bus; 317 + int ret; 320 318 321 - bus = devm_mdiobus_alloc(dev->dev); 322 - if (!bus) 323 - return -ENOMEM; 319 + bus = devm_mdiobus_alloc(dev->dev); 320 + if (!bus) 321 + return -ENOMEM; 324 322 325 - bus->name = "ksz_pcs_mdio_bus"; 326 - snprintf(bus->id, MII_BUS_ID_SIZE, "%s-pcs", 327 - dev_name(dev->dev)); 328 - bus->read_c45 = &ksz9477_pcs_read; 329 - bus->write_c45 = &ksz9477_pcs_write; 330 - bus->parent = dev->dev; 331 - bus->phy_mask = ~0; 332 - bus->priv = dev; 323 + bus->name = "ksz_pcs_mdio_bus"; 324 + snprintf(bus->id, MII_BUS_ID_SIZE, "%s-pcs", 325 + dev_name(dev->dev)); 326 + bus->read_c45 = &ksz9477_pcs_read; 327 + bus->write_c45 = &ksz9477_pcs_write; 328 + bus->parent = dev->dev; 329 + bus->phy_mask = ~0; 330 + bus->priv = dev; 333 331 334 - ret = devm_mdiobus_register(dev->dev, bus); 335 - if (ret) 336 - return ret; 332 + ret = devm_mdiobus_register(dev->dev, bus); 333 + if (ret) 334 + return ret; 337 335 338 - pcs = xpcs_create_pcs_mdiodev(bus, 0); 339 - if (IS_ERR(pcs)) 340 - return PTR_ERR(pcs); 341 - p->pcs = pcs; 342 - } 336 + pcs = xpcs_create_pcs_mdiodev(bus, 0); 337 + if (IS_ERR(pcs)) 338 + return PTR_ERR(pcs); 339 + p->pcs = pcs; 343 340 344 341 return 0; 345 342 } ··· 525 528 * A fixed PHY can be setup in the device tree, but this function is 526 529 * still called for that port during initialization. 527 530 * For RGMII PHY there is no way to access it so the fixed PHY should 528 - * be used. For SGMII PHY the supporting code will be added later. 531 + * be used. 529 532 */ 530 533 if (!dev->info->internal_phy[addr]) { 531 534 struct ksz_port *p = &dev->ports[addr];