diff options
author | Daniel Golle <daniel@makrotopia.org> | 2019-03-04 04:04:52 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2019-03-04 04:04:52 +0100 |
commit | 3bb9dcf44627ffdd313fe92c563ae454b6ff8aa6 (patch) | |
tree | bfec5288d0d068162bd3cd6b794454379c1a4641 /target/linux/oxnas/files/drivers/pci | |
parent | 302f7d57a9ad31d71e737af8932aa8e86c476699 (diff) | |
download | upstream-3bb9dcf44627ffdd313fe92c563ae454b6ff8aa6.tar.gz upstream-3bb9dcf44627ffdd313fe92c563ae454b6ff8aa6.tar.bz2 upstream-3bb9dcf44627ffdd313fe92c563ae454b6ff8aa6.zip |
oxnas: convert pcie to builtin_platform_driver
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/oxnas/files/drivers/pci')
-rw-r--r-- | target/linux/oxnas/files/drivers/pci/host/pcie-oxnas.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/target/linux/oxnas/files/drivers/pci/host/pcie-oxnas.c b/target/linux/oxnas/files/drivers/pci/host/pcie-oxnas.c index d69820d2aa..76e42d13ef 100644 --- a/target/linux/oxnas/files/drivers/pci/host/pcie-oxnas.c +++ b/target/linux/oxnas/files/drivers/pci/host/pcie-oxnas.c @@ -1,6 +1,8 @@ /* * PCIe driver for PLX NAS782X SoCs * + * Author: Ma Haijun <mahaijuns@gmail.com> + * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. @@ -192,7 +194,7 @@ static int oxnas_pcie_link_up(struct oxnas_pcie *pcie) return 0; } -static void __init oxnas_pcie_setup_hw(struct oxnas_pcie *pcie) +static void oxnas_pcie_setup_hw(struct oxnas_pcie *pcie) { /* We won't have any inbound address translation. This allows PCI * devices to access anywhere in the AHB address map. Might be regarded @@ -362,7 +364,7 @@ static struct pci_ops oxnas_pcie_ops = { .write = oxnas_pcie_wr_conf, }; -static int __init oxnas_pcie_setup(int nr, struct pci_sys_data *sys) +static int oxnas_pcie_setup(int nr, struct pci_sys_data *sys) { struct oxnas_pcie *pcie = sys_to_pcie(sys); @@ -384,7 +386,7 @@ static int __init oxnas_pcie_setup(int nr, struct pci_sys_data *sys) return 1; } -static void __init oxnas_pcie_enable(struct device *dev, struct oxnas_pcie *pcie) +static void oxnas_pcie_enable(struct device *dev, struct oxnas_pcie *pcie) { struct hw_pci hw; int i; @@ -466,7 +468,7 @@ static void oxnas_pcie_shared_deinit(struct platform_device *pdev) } #endif -static int __init +static int oxnas_pcie_map_registers(struct platform_device *pdev, struct device_node *np, struct oxnas_pcie *pcie) @@ -505,7 +507,7 @@ oxnas_pcie_map_registers(struct platform_device *pdev, return 0; } -static int __init oxnas_pcie_init_res(struct platform_device *pdev, +static int oxnas_pcie_init_res(struct platform_device *pdev, struct oxnas_pcie *pcie, struct device_node *np) { @@ -624,7 +626,7 @@ static void oxnas_pcie_init_hw(struct platform_device *pdev, wmb(); } -static int __init oxnas_pcie_probe(struct platform_device *pdev) +static int oxnas_pcie_probe(struct platform_device *pdev) { struct oxnas_pcie *pcie; struct device_node *np = pdev->dev.of_node; @@ -693,25 +695,14 @@ static const struct of_device_id oxnas_pcie_of_match_table[] = { { .compatible = "plxtech,nas782x-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, oxnas_pcie_of_match_table); static struct platform_driver oxnas_pcie_driver = { .driver = { - .owner = THIS_MODULE, .name = "oxnas-pcie", - .of_match_table = - of_match_ptr(oxnas_pcie_of_match_table), + .suppress_bind_attrs = true, + .of_match_table = oxnas_pcie_of_match_table, }, + .probe = oxnas_pcie_probe, }; -static int __init oxnas_pcie_init(void) -{ - return platform_driver_probe(&oxnas_pcie_driver, - oxnas_pcie_probe); -} - -subsys_initcall(oxnas_pcie_init); - -MODULE_AUTHOR("Ma Haijun <mahaijuns@gmail.com>"); -MODULE_DESCRIPTION("NAS782x PCIe driver"); -MODULE_LICENSE("GPLv2"); +builtin_platform_driver(oxnas_pcie_driver); |