tree: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git topic/phy-reset-v3 head: a1d46e588cf5f3554d849614ae91db6f30933ea5 commit: 155bdea9cfe35268946786014dc01998acb7edbd [1/4] phylib: Add device reset GPIO support config: x86_64-randconfig-x019-201744 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout 155bdea9cfe35268946786014dc01998acb7edbd # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): drivers/of/of_mdio.c: In function 'of_mdiobus_register_phy': >> drivers/of/of_mdio.c:65:10: warning: 'return' with a value, in function returning void return PTR_ERR(gpiod); ^~~~~~~~~~~~~~ drivers/of/of_mdio.c:47:13: note: declared here static void of_mdiobus_register_phy(struct mii_bus *mdio, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/of/of_mdio.c: In function 'of_mdiobus_register_device': drivers/of/of_mdio.c:130:10: warning: 'return' with a value, in function returning void return PTR_ERR(gpiod); ^~~~~~~~~~~~~~ drivers/of/of_mdio.c:108:13: note: declared here static void of_mdiobus_register_device(struct mii_bus *mdio, ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/of/of_mdio.c:130:10: warning: ignoring return value of 'PTR_ERR', declared with attribute warn_unused_result [-Wunused-result] return PTR_ERR(gpiod); ^~~~~~~~~~~~~~ drivers/of/of_mdio.c: In function 'of_mdiobus_register_phy': drivers/of/of_mdio.c:65:10: warning: ignoring return value of 'PTR_ERR', declared with attribute warn_unused_result [-Wunused-result] return PTR_ERR(gpiod); ^~~~~~~~~~~~~~ vim +/return +65 drivers/of/of_mdio.c 46 47 static void of_mdiobus_register_phy(struct mii_bus *mdio, 48 struct device_node *child, u32 addr) 49 { 50 struct gpio_desc *gpiod; 51 struct phy_device *phy; 52 bool is_c45; 53 int rc; 54 u32 phy_id; 55 56 is_c45 = of_device_is_compatible(child, 57 "ethernet-phy-ieee802.3-c45"); 58 59 /* Deassert the optional reset signal */ 60 gpiod = fwnode_get_named_gpiod(&child->fwnode, "reset-gpios", 0, 61 GPIOD_OUT_LOW, "PHY reset"); 62 if (PTR_ERR(gpiod) == -ENOENT) 63 gpiod = NULL; 64 else if (IS_ERR(gpiod)) > 65 return PTR_ERR(gpiod); 66 67 if (!is_c45 && !of_get_phy_id(child, &phy_id)) 68 phy = phy_device_create(mdio, addr, phy_id, 0, NULL); 69 else 70 phy = get_phy_device(mdio, addr, is_c45); 71 72 /* Assert the reset signal again */ 73 gpiod_set_value(gpiod, 1); 74 75 if (IS_ERR(phy)) 76 return; 77 78 rc = irq_of_parse_and_map(child, 0); 79 if (rc > 0) { 80 phy->irq = rc; 81 mdio->irq[addr] = rc; 82 } else { 83 phy->irq = mdio->irq[addr]; 84 } 85 86 if (of_property_read_bool(child, "broken-turn-around")) 87 mdio->phy_ignore_ta_mask |= 1 << addr; 88 89 /* Associate the OF node with the device structure so it 90 * can be looked up later */ 91 of_node_get(child); 92 phy->mdio.dev.of_node = child; 93 phy->mdio.reset = gpiod; 94 95 /* All data is now stored in the phy struct; 96 * register it */ 97 rc = phy_device_register(phy); 98 if (rc) { 99 phy_device_free(phy); 100 of_node_put(child); 101 return; 102 } 103 104 dev_dbg(&mdio->dev, "registered phy %s at address %i\n", 105 child->name, addr); 106 } 107 108 static void of_mdiobus_register_device(struct mii_bus *mdio, 109 struct device_node *child, u32 addr) 110 { 111 struct mdio_device *mdiodev; 112 struct gpio_desc *gpiod; 113 int rc; 114 115 mdiodev = mdio_device_create(mdio, addr); 116 if (IS_ERR(mdiodev)) 117 return; 118 119 /* Associate the OF node with the device structure so it 120 * can be looked up later. 121 */ 122 of_node_get(child); 123 mdiodev->dev.of_node = child; 124 125 gpiod = fwnode_get_named_gpiod(&child->fwnode, "reset-gpios", 0, 126 GPIOD_ASIS, "PHY reset"); 127 if (PTR_ERR(gpiod) == -ENOENT) 128 gpiod = NULL; 129 else if (IS_ERR(gpiod)) > 130 return PTR_ERR(gpiod); 131 mdiodev->reset = gpiod; 132 133 /* All data is now stored in the mdiodev struct; register it. */ 134 rc = mdio_device_register(mdiodev); 135 if (rc) { 136 mdio_device_free(mdiodev); 137 of_node_put(child); 138 return; 139 } 140 141 dev_dbg(&mdio->dev, "registered mdio device %s at address %i\n", 142 child->name, addr); 143 } 144 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip