@@ -2651,20 +2651,18 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26512651 }
26522652
26532653 /*
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
26552655 * have AER disabled in the kernel.
2656+ *
2657+ * Cleanup nonfatal error status before getting to init.
26562658 */
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 );
26622660
26632661 /* First enable the PCI device */
26642662 ret = pcim_enable_device (pdev );
26652663 if (ret != 0 ) {
26662664 dev_err (& pdev -> dev , "Failed to enable PCIe device\n" );
2667- goto err_disable_aer ;
2665+ return ret ;
26682666 }
26692667
26702668 /*
@@ -2692,8 +2690,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26922690
26932691err_clear_master :
26942692 pci_clear_master (pdev );
2695- err_disable_aer :
2696- (void )pci_disable_pcie_error_reporting (pdev );
26972693
26982694 return ret ;
26992695}
@@ -2714,9 +2710,6 @@ static void idt_deinit_pci(struct idt_ntb_dev *ndev)
27142710 /* Clear the bus master disabling the Request TLPs translation */
27152711 pci_clear_master (pdev );
27162712
2717- /* Disable the AER capability */
2718- (void )pci_disable_pcie_error_reporting (pdev );
2719-
27202713 dev_dbg (& pdev -> dev , "NT-function PCIe interface cleared" );
27212714}
27222715
@@ -2891,14 +2884,19 @@ static struct pci_driver idt_pci_driver = {
28912884
28922885static int __init idt_pci_driver_init (void )
28932886{
2887+ int ret ;
28942888 pr_info ("%s %s\n" , NTB_DESC , NTB_VER );
28952889
28962890 /* Create the top DebugFS directory if the FS is initialized */
28972891 if (debugfs_initialized ())
28982892 dbgfs_topdir = debugfs_create_dir (KBUILD_MODNAME , NULL );
28992893
29002894 /* 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 ;
29022900}
29032901module_init (idt_pci_driver_init );
29042902
0 commit comments