ソースを参照

soft_3rdpart: codaj12: Fixed the issue that getting IRQ failed in linux 6.1

platform_get_resource(pdev, IORESOURCE_IRQ, 0) will failed in linux 6.1,
using platform_get_irq instead.

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
(cherry picked from commit efcc4f23c4ec74a1cfbbf16d0d94e468eae2ecac)
Samin Guo 1 年間 前
コミット
7aa004cd32
1 ファイル変更4 行追加3 行削除
  1. 4 3
      codaj12/jdi/linux/driver/jpu.c

+ 4 - 3
codaj12/jdi/linux/driver/jpu.c

@@ -852,6 +852,7 @@ static int jpu_probe(struct platform_device *pdev)
 	struct resource res_cma;
 	struct device_node *node;
 #endif
+	int irq = -1;
 
     DPRINTK("[JPUDRV] jpu_probe\n");
     if (pdev) {
@@ -923,9 +924,9 @@ static int jpu_probe(struct platform_device *pdev)
 #ifdef JPU_SUPPORT_ISR
 #ifdef JPU_SUPPORT_PLATFORM_DRIVER_REGISTER
     if(pdev)
-        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-    if (res) {/* if platform driver is implemented */
-        s_jpu_irq = res->start;
+        irq = platform_get_irq(pdev, 0);
+    if (irq >= 0) {/* if platform driver is implemented */
+        s_jpu_irq = irq;
         DPRINTK("[JPUDRV] : jpu irq number get from platform driver irq=0x%x\n", s_jpu_irq );
     } else {
         DPRINTK("[JPUDRV] : jpu irq number get from defined value irq=0x%x\n", s_jpu_irq );