Lines Matching +full:bus +full:- +full:err
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
9 #define ENETC_MDIO_BUS_NAME ENETC_MDIO_DEV_NAME " Bus"
16 struct device *dev = &pdev->dev; in enetc_pci_mdio_probe()
19 struct mii_bus *bus; in enetc_pci_mdio_probe() local
20 int err; in enetc_pci_mdio_probe() local
25 err = -ENXIO; in enetc_pci_mdio_probe()
31 err = PTR_ERR(hw); in enetc_pci_mdio_probe()
35 bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); in enetc_pci_mdio_probe()
36 if (!bus) { in enetc_pci_mdio_probe()
37 err = -ENOMEM; in enetc_pci_mdio_probe()
41 bus->name = ENETC_MDIO_BUS_NAME; in enetc_pci_mdio_probe()
42 bus->read = enetc_mdio_read_c22; in enetc_pci_mdio_probe()
43 bus->write = enetc_mdio_write_c22; in enetc_pci_mdio_probe()
44 bus->read_c45 = enetc_mdio_read_c45; in enetc_pci_mdio_probe()
45 bus->write_c45 = enetc_mdio_write_c45; in enetc_pci_mdio_probe()
46 bus->parent = dev; in enetc_pci_mdio_probe()
47 mdio_priv = bus->priv; in enetc_pci_mdio_probe()
48 mdio_priv->hw = hw; in enetc_pci_mdio_probe()
49 mdio_priv->mdio_base = ENETC_EMDIO_BASE; in enetc_pci_mdio_probe()
50 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(dev)); in enetc_pci_mdio_probe()
53 err = pci_enable_device_mem(pdev); in enetc_pci_mdio_probe()
54 if (err) { in enetc_pci_mdio_probe()
59 err = pci_request_region(pdev, 0, KBUILD_MODNAME); in enetc_pci_mdio_probe()
60 if (err) { in enetc_pci_mdio_probe()
65 err = of_mdiobus_register(bus, dev->of_node); in enetc_pci_mdio_probe()
66 if (err) in enetc_pci_mdio_probe()
69 pci_set_drvdata(pdev, bus); in enetc_pci_mdio_probe()
82 return err; in enetc_pci_mdio_probe()
87 struct mii_bus *bus = pci_get_drvdata(pdev); in enetc_pci_mdio_remove() local
90 mdiobus_unregister(bus); in enetc_pci_mdio_remove()
91 mdio_priv = bus->priv; in enetc_pci_mdio_remove()
92 iounmap(mdio_priv->hw->port); in enetc_pci_mdio_remove()