.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * netup_unidvb_core.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Copyright (C) 2014 NetUP Inc. |
---|
7 | 8 | * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru> |
---|
8 | 9 | * 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. |
---|
19 | 10 | */ |
---|
20 | 11 | |
---|
21 | 12 | #include <linux/init.h> |
---|
.. | .. |
---|
706 | 697 | netup_unidvb_dma_enable(dma, 0); |
---|
707 | 698 | msleep(50); |
---|
708 | 699 | cancel_work_sync(&dma->work); |
---|
709 | | - del_timer(&dma->timeout); |
---|
| 700 | + del_timer_sync(&dma->timeout); |
---|
710 | 701 | } |
---|
711 | 702 | |
---|
712 | 703 | static int netup_unidvb_dma_setup(struct netup_unidvb_dev *ndev) |
---|
.. | .. |
---|
896 | 887 | ndev->lmmio0, (u32)pci_resource_len(pci_dev, 0), |
---|
897 | 888 | ndev->lmmio1, (u32)pci_resource_len(pci_dev, 1), |
---|
898 | 889 | 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 | + |
---|
905 | 891 | ndev->dma_size = 2 * 188 * |
---|
906 | 892 | NETUP_DMA_BLOCKS_COUNT * NETUP_DMA_PACKETS_COUNT; |
---|
907 | 893 | ndev->dma_virt = dma_alloc_coherent(&pci_dev->dev, |
---|
.. | .. |
---|
942 | 928 | dev_err(&pci_dev->dev, "netup_unidvb: DMA setup failed\n"); |
---|
943 | 929 | goto dma_setup_err; |
---|
944 | 930 | } |
---|
| 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 | + |
---|
945 | 939 | dev_info(&pci_dev->dev, |
---|
946 | 940 | "netup_unidvb: device has been initialized\n"); |
---|
947 | 941 | return 0; |
---|
.. | .. |
---|
960 | 954 | dma_free_coherent(&pci_dev->dev, ndev->dma_size, |
---|
961 | 955 | ndev->dma_virt, ndev->dma_phys); |
---|
962 | 956 | dma_alloc_err: |
---|
963 | | - free_irq(pci_dev->irq, pci_dev); |
---|
964 | | -irq_request_err: |
---|
965 | 957 | iounmap(ndev->lmmio1); |
---|
966 | 958 | pci_bar1_error: |
---|
967 | 959 | iounmap(ndev->lmmio0); |
---|
.. | .. |
---|
1030 | 1022 | .id_table = netup_unidvb_pci_tbl, |
---|
1031 | 1023 | .probe = netup_unidvb_initdev, |
---|
1032 | 1024 | .remove = netup_unidvb_finidev, |
---|
1033 | | - .suspend = NULL, |
---|
1034 | | - .resume = NULL, |
---|
1035 | 1025 | }; |
---|
1036 | 1026 | |
---|
1037 | 1027 | module_pci_driver(netup_unidvb_pci_driver); |
---|