0151-lantiq-ifxmips_pcie-use-of.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. +#include <linux/of_platform.h>
  7. +
  8. #include "ifxmips_pcie.h"
  9. #include "ifxmips_pcie_reg.h"
  10. @@ -1045,7 +1047,7 @@ pcie_rc_initialize(int pcie_port)
  11. return 0;
  12. }
  13. -static int __init ifx_pcie_bios_init(void)
  14. +static int __init ifx_pcie_bios_probe(struct platform_device *pdev)
  15. {
  16. void __iomem *io_map_base;
  17. int pcie_port;
  18. @@ -1083,6 +1085,30 @@ static int __init ifx_pcie_bios_init(voi
  19. return 0;
  20. }
  21. +
  22. +static const struct of_device_id ifxmips_pcie_match[] = {
  23. + { .compatible = "lantiq,pcie-xrx200" },
  24. + {},
  25. +};
  26. +MODULE_DEVICE_TABLE(of, ifxmips_pcie_match);
  27. +
  28. +static struct platform_driver ltq_pci_driver = {
  29. + .probe = ifx_pcie_bios_probe,
  30. + .driver = {
  31. + .name = "pcie-xrx200",
  32. + .owner = THIS_MODULE,
  33. + .of_match_table = ifxmips_pcie_match,
  34. + },
  35. +};
  36. +
  37. +int __init ifx_pcie_bios_init(void)
  38. +{
  39. + int ret = platform_driver_register(&ltq_pci_driver);
  40. + if (ret)
  41. + pr_info("pcie-xrx200: Error registering platform driver!");
  42. + return ret;
  43. +}
  44. +
  45. arch_initcall(ifx_pcie_bios_init);
  46. MODULE_LICENSE("GPL");