@@ -2651,20 +2651,18 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
2651
2651
}
2652
2652
2653
2653
/*
2654
- * Enable the device advanced error reporting. It's not critical to
2654
+ * The PCI core enables device error reporting. It's not critical to
2655
2655
* have AER disabled in the kernel.
2656
+ *
2657
+ * Cleanup nonfatal error status before getting to init.
2656
2658
*/
2657
- ret = pci_enable_pcie_error_reporting (pdev );
2658
- if (ret != 0 )
2659
- dev_warn (& pdev -> dev , "PCIe AER capability disabled\n" );
2660
- else /* Cleanup nonfatal error status before getting to init */
2661
- pci_aer_clear_nonfatal_status (pdev );
2659
+ pci_aer_clear_nonfatal_status (pdev );
2662
2660
2663
2661
/* First enable the PCI device */
2664
2662
ret = pcim_enable_device (pdev );
2665
2663
if (ret != 0 ) {
2666
2664
dev_err (& pdev -> dev , "Failed to enable PCIe device\n" );
2667
- goto err_disable_aer ;
2665
+ return ret ;
2668
2666
}
2669
2667
2670
2668
/*
@@ -2692,8 +2690,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
2692
2690
2693
2691
err_clear_master :
2694
2692
pci_clear_master (pdev );
2695
- err_disable_aer :
2696
- (void )pci_disable_pcie_error_reporting (pdev );
2697
2693
2698
2694
return ret ;
2699
2695
}
@@ -2714,9 +2710,6 @@ static void idt_deinit_pci(struct idt_ntb_dev *ndev)
2714
2710
/* Clear the bus master disabling the Request TLPs translation */
2715
2711
pci_clear_master (pdev );
2716
2712
2717
- /* Disable the AER capability */
2718
- (void )pci_disable_pcie_error_reporting (pdev );
2719
-
2720
2713
dev_dbg (& pdev -> dev , "NT-function PCIe interface cleared" );
2721
2714
}
2722
2715
@@ -2891,14 +2884,19 @@ static struct pci_driver idt_pci_driver = {
2891
2884
2892
2885
static int __init idt_pci_driver_init (void )
2893
2886
{
2887
+ int ret ;
2894
2888
pr_info ("%s %s\n" , NTB_DESC , NTB_VER );
2895
2889
2896
2890
/* Create the top DebugFS directory if the FS is initialized */
2897
2891
if (debugfs_initialized ())
2898
2892
dbgfs_topdir = debugfs_create_dir (KBUILD_MODNAME , NULL );
2899
2893
2900
2894
/* Register the NTB hardware driver to handle the PCI device */
2901
- return pci_register_driver (& idt_pci_driver );
2895
+ ret = pci_register_driver (& idt_pci_driver );
2896
+ if (ret )
2897
+ debugfs_remove_recursive (dbgfs_topdir );
2898
+
2899
+ return ret ;
2902
2900
}
2903
2901
module_init (idt_pci_driver_init );
2904
2902
0 commit comments