From: Hauke Mehrtens Date: Thu, 4 Dec 2025 20:12:24 +0000 (+0100) Subject: ramips: Fix cmpilation X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=27e5d7ddd974dbf1843df10ca6a0c6bc2b7e1134;p=openwrt%2Fstaging%2Fxback.git ramips: Fix cmpilation Fixes this compile problem: ``` drivers/net/ethernet/ralink/esw_rt3050.c: In function 'rt3050_esw_init': drivers/net/ethernet/ralink/esw_rt3050.c:1467:12: error: 'pdev' is used uninitialized [-Werror=uninitialized] 1467 | if (!pdev) | ^ drivers/net/ethernet/ralink/esw_rt3050.c:1461:33: note: 'pdev' was declared here 1461 | struct platform_device *pdev; | ^~~~ cc1: all warnings being treated as errors ``` Fixes: 4ffd5aa239c1 ("treewide: fix coccinelle checks") Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c index 5b3f21c92f..3bf2c2e83c 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c @@ -1464,13 +1464,13 @@ int rt3050_esw_init(struct fe_priv *priv) const __be32 *rgmii; int ret; - if (!pdev) - return -ENODEV; - if (!of_device_is_compatible(np, ralink_esw_match->compatible)) return -EINVAL; pdev = of_find_device_by_node(np); + if (!pdev) + return -ENODEV; + esw = platform_get_drvdata(pdev); if (!esw) { put_device(&pdev->dev);