local/pci: pcie-designware: change return type for host_init() callback
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 20 Mar 2015 06:26:51 +0000 (15:26 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:44:28 +0000 (13:44 +0900)
host_init() can be failed.
If host_init() callback is failed, it has to fail probe.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/pci/host/pcie-designware.c
drivers/pci/host/pcie-designware.h

index 12430f9..37c4e87 100644 (file)
@@ -499,8 +499,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
                }
        }
 
-       if (pp->ops->host_init)
-               pp->ops->host_init(pp);
+       if (pp->ops->host_init) {
+               ret = pp->ops->host_init(pp);
+               if (ret)
+                       return ret;
+       }
 
        dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0);
 
index d0bbd27..e14f746 100644 (file)
@@ -67,7 +67,7 @@ struct pcie_host_ops {
        int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
                        unsigned int devfn, int where, int size, u32 val);
        int (*link_up)(struct pcie_port *pp);
-       void (*host_init)(struct pcie_port *pp);
+       int (*host_init)(struct pcie_port *pp);
        void (*msi_set_irq)(struct pcie_port *pp, int irq);
        void (*msi_clear_irq)(struct pcie_port *pp, int irq);
        u32 (*get_msi_addr)(struct pcie_port *pp);