kernel: update 3.18 to 3.18.16
[15.05/openwrt.git] / target / linux / lantiq / patches-3.18 / 0151-lantiq-ifxmips_pcie-use-of.patch
1 --- a/arch/mips/pci/ifxmips_pcie.c
2 +++ b/arch/mips/pci/ifxmips_pcie.c
3 @@ -18,6 +18,8 @@
4  #include <linux/pci_regs.h>
5  #include <linux/module.h>
6  
7 +#include <linux/of_platform.h>
8 +
9  #include "ifxmips_pcie.h"
10  #include "ifxmips_pcie_reg.h"
11  
12 @@ -1045,7 +1047,7 @@ pcie_rc_initialize(int pcie_port)
13         return 0;
14  }
15  
16 -static int __init ifx_pcie_bios_init(void)
17 +static int __init ifx_pcie_bios_probe(struct platform_device *pdev)
18  {
19      void __iomem *io_map_base;
20      int pcie_port;
21 @@ -1083,6 +1085,30 @@ static int __init ifx_pcie_bios_init(voi
22  
23      return 0;
24  }
25 +
26 +static const struct of_device_id ifxmips_pcie_match[] = {
27 +        { .compatible = "lantiq,pcie-xrx200" },
28 +        {},
29 +};
30 +MODULE_DEVICE_TABLE(of, ifxmips_pcie_match);
31 +
32 +static struct platform_driver ltq_pci_driver = {
33 +        .probe = ifx_pcie_bios_probe,
34 +        .driver = {
35 +                .name = "pcie-xrx200",
36 +                .owner = THIS_MODULE,
37 +                .of_match_table = ifxmips_pcie_match,
38 +        },
39 +};
40 +
41 +int __init ifx_pcie_bios_init(void)
42 +{
43 +        int ret = platform_driver_register(&ltq_pci_driver);
44 +        if (ret)
45 +                pr_info("pcie-xrx200: Error registering platform driver!");
46 +        return ret;
47 +}
48 +
49  arch_initcall(ifx_pcie_bios_init);
50  
51  MODULE_LICENSE("GPL");