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.

net: phy: mediatek: do not require syscon compatible for pio property

Current implementation requires syscon compatible for pio property
which is used for driving the switch leds on mt7988.

Replace syscon_regmap_lookup_by_phandle with of_parse_phandle and
device_node_to_regmap to get the regmap already assigned by pinctrl
driver.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://patch.msgid.link/20250510174933.154589-1-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Frank Wunderlich and committed by
Jakub Kicinski
15d7b3df 894fbb55

+9 -1
+9 -1
drivers/net/phy/mediatek/mtk-ge-soc.c
··· 7 7 #include <linux/pinctrl/consumer.h> 8 8 #include <linux/phy.h> 9 9 #include <linux/regmap.h> 10 + #include <linux/of.h> 10 11 11 12 #include "../phylib.h" 12 13 #include "mtk.h" ··· 1323 1322 { 1324 1323 struct device_node *np = dev_of_node(&phydev->mdio.bus->dev); 1325 1324 struct mtk_socphy_shared *shared = phy_package_get_priv(phydev); 1325 + struct device_node *pio_np; 1326 1326 struct regmap *regmap; 1327 1327 u32 reg; 1328 1328 int ret; ··· 1341 1339 * The 4 bits in TPBANK0 are kept as package shared data and are used to 1342 1340 * set LED polarity for each of the LED0. 1343 1341 */ 1344 - regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,pio"); 1342 + pio_np = of_parse_phandle(np, "mediatek,pio", 0); 1343 + if (!pio_np) 1344 + return -ENODEV; 1345 + 1346 + regmap = device_node_to_regmap(pio_np); 1347 + of_node_put(pio_np); 1348 + 1345 1349 if (IS_ERR(regmap)) 1346 1350 return PTR_ERR(regmap); 1347 1351