forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * netup_unidvb_core.c
34 *
....@@ -6,16 +7,6 @@
67 * Copyright (C) 2014 NetUP Inc.
78 * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
89 * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
1910 */
2011
2112 #include <linux/init.h>
....@@ -706,7 +697,7 @@
706697 netup_unidvb_dma_enable(dma, 0);
707698 msleep(50);
708699 cancel_work_sync(&dma->work);
709
- del_timer(&dma->timeout);
700
+ del_timer_sync(&dma->timeout);
710701 }
711702
712703 static int netup_unidvb_dma_setup(struct netup_unidvb_dev *ndev)
....@@ -896,12 +887,7 @@
896887 ndev->lmmio0, (u32)pci_resource_len(pci_dev, 0),
897888 ndev->lmmio1, (u32)pci_resource_len(pci_dev, 1),
898889 pci_dev->irq);
899
- if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
900
- "netup_unidvb", pci_dev) < 0) {
901
- dev_err(&pci_dev->dev,
902
- "%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
903
- goto irq_request_err;
904
- }
890
+
905891 ndev->dma_size = 2 * 188 *
906892 NETUP_DMA_BLOCKS_COUNT * NETUP_DMA_PACKETS_COUNT;
907893 ndev->dma_virt = dma_alloc_coherent(&pci_dev->dev,
....@@ -942,6 +928,14 @@
942928 dev_err(&pci_dev->dev, "netup_unidvb: DMA setup failed\n");
943929 goto dma_setup_err;
944930 }
931
+
932
+ if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
933
+ "netup_unidvb", pci_dev) < 0) {
934
+ dev_err(&pci_dev->dev,
935
+ "%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
936
+ goto dma_setup_err;
937
+ }
938
+
945939 dev_info(&pci_dev->dev,
946940 "netup_unidvb: device has been initialized\n");
947941 return 0;
....@@ -960,8 +954,6 @@
960954 dma_free_coherent(&pci_dev->dev, ndev->dma_size,
961955 ndev->dma_virt, ndev->dma_phys);
962956 dma_alloc_err:
963
- free_irq(pci_dev->irq, pci_dev);
964
-irq_request_err:
965957 iounmap(ndev->lmmio1);
966958 pci_bar1_error:
967959 iounmap(ndev->lmmio0);
....@@ -1030,8 +1022,6 @@
10301022 .id_table = netup_unidvb_pci_tbl,
10311023 .probe = netup_unidvb_initdev,
10321024 .remove = netup_unidvb_finidev,
1033
- .suspend = NULL,
1034
- .resume = NULL,
10351025 };
10361026
10371027 module_pci_driver(netup_unidvb_pci_driver);