aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-05-06 22:38:42 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-05-12 03:15:37 +0200
commit7f54fa575b33d266f91f67dbb9a0c2c0af7aca7e (patch)
treefdf32e2a3197b99a7aced12bf9b3666b1cc3ac17 /target
parentb545df5cfd4a8d4cb6656ac79a5cfc0eed9971c0 (diff)
downloadupstream-7f54fa575b33d266f91f67dbb9a0c2c0af7aca7e.tar.gz
upstream-7f54fa575b33d266f91f67dbb9a0c2c0af7aca7e.tar.bz2
upstream-7f54fa575b33d266f91f67dbb9a0c2c0af7aca7e.zip
ramips: mt7620: handle request_irq fail in gsw ethernet driver
Handle return from request_irq in gsw ethernet driver. Fix compilation warning: drivers/net/ethernet/ralink/gsw_mt7620.c: In function 'mtk_gsw_init': drivers/net/ethernet/ralink/gsw_mt7620.c:236:17: error: ignoring return value of 'request_irq' declared with attribute 'warn_unused_result' [-Werror=unused-result] 236 | request_irq(gsw->irq, gsw_interrupt_mt7620, 0, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 237 | "gsw", priv); | ~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 615544cb17..84b6e305a4 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -197,6 +197,7 @@ int mtk_gsw_init(struct fe_priv *priv)
struct platform_device *pdev = of_find_device_by_node(np);
struct mt7620_gsw *gsw;
const __be32 *id;
+ int ret;
u8 val;
if (!pdev)
@@ -233,8 +234,12 @@ int mtk_gsw_init(struct fe_priv *priv)
mt7620_ephy_init(gsw);
if (gsw->irq) {
- request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
- "gsw", priv);
+ ret = request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
+ "gsw", priv);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to request irq");
+ return ret;
+ }
mtk_switch_w32(gsw, ~PORT_IRQ_ST_CHG, GSW_REG_IMR);
}