aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorBirger Koblitz <git@birger-koblitz.de>2022-01-11 14:23:23 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-02-17 15:21:47 +0000
commita82583594277e12d31254697aa6b034f4b59f6f5 (patch)
treedd1b581a7b1e53b198fd5b19a07dcd9876560d58 /target/linux/realtek
parenta75b9e3ecb61c00f026459d2d6a3e465f9346543 (diff)
downloadupstream-a82583594277e12d31254697aa6b034f4b59f6f5.tar.gz
upstream-a82583594277e12d31254697aa6b034f4b59f6f5.tar.bz2
upstream-a82583594277e12d31254697aa6b034f4b59f6f5.zip
realtek: Improve IRQ request in Ethernet driver
Improves the IRQ request code by using platform_get_irq() which provides better error handling. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
index 6db2b2a1fe..84b8a5b943 100644
--- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
@@ -2209,14 +2209,13 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
spin_lock_init(&priv->lock);
- /* obtain device IRQ number */
- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!res) {
+ /* Obtain device IRQ number */
+ dev->irq = platform_get_irq(pdev, 0);
+ if (dev->irq < 0) {
dev_err(&pdev->dev, "cannot obtain IRQ, using default 24\n");
dev->irq = 24;
- } else {
- dev->irq = res->start;
}
+
dev->ethtool_ops = &rtl838x_ethtool_ops;
dev->min_mtu = ETH_ZLEN;
dev->max_mtu = 1536;