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>
This commit is contained in:
parent
b545df5cfd
commit
7f54fa575b
1 changed files with 7 additions and 2 deletions
|
@ -197,6 +197,7 @@ int mtk_gsw_init(struct fe_priv *priv)
|
||||||
struct platform_device *pdev = of_find_device_by_node(np);
|
struct platform_device *pdev = of_find_device_by_node(np);
|
||||||
struct mt7620_gsw *gsw;
|
struct mt7620_gsw *gsw;
|
||||||
const __be32 *id;
|
const __be32 *id;
|
||||||
|
int ret;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
if (!pdev)
|
if (!pdev)
|
||||||
|
@ -233,8 +234,12 @@ int mtk_gsw_init(struct fe_priv *priv)
|
||||||
mt7620_ephy_init(gsw);
|
mt7620_ephy_init(gsw);
|
||||||
|
|
||||||
if (gsw->irq) {
|
if (gsw->irq) {
|
||||||
request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
|
ret = request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
|
||||||
"gsw", priv);
|
"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);
|
mtk_switch_w32(gsw, ~PORT_IRQ_ST_CHG, GSW_REG_IMR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue