x86/unwinder: Handle stack overflows more gracefully
[linux/fpc-iii.git] / drivers / fpga / altera-pr-ip-core-plat.c
blob8fb36b8b4648e6bab6d11e1d1ddff0d6d1a7461d
1 /*
2 * Driver for Altera Partial Reconfiguration IP Core
4 * Copyright (C) 2016-2017 Intel Corporation
6 * Based on socfpga-a10.c Copyright (C) 2015-2016 Altera Corporation
7 * by Alan Tull <atull@opensource.altera.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License,
11 * version 2, as published by the Free Software Foundation.
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <linux/fpga/altera-pr-ip-core.h>
22 #include <linux/module.h>
23 #include <linux/of_device.h>
25 static int alt_pr_platform_probe(struct platform_device *pdev)
27 struct device *dev = &pdev->dev;
28 void __iomem *reg_base;
29 struct resource *res;
31 /* First mmio base is for register access */
32 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
34 reg_base = devm_ioremap_resource(dev, res);
36 if (IS_ERR(reg_base))
37 return PTR_ERR(reg_base);
39 return alt_pr_register(dev, reg_base);
42 static int alt_pr_platform_remove(struct platform_device *pdev)
44 struct device *dev = &pdev->dev;
46 return alt_pr_unregister(dev);
49 static const struct of_device_id alt_pr_of_match[] = {
50 { .compatible = "altr,a10-pr-ip", },
51 {},
54 MODULE_DEVICE_TABLE(of, alt_pr_of_match);
56 static struct platform_driver alt_pr_platform_driver = {
57 .probe = alt_pr_platform_probe,
58 .remove = alt_pr_platform_remove,
59 .driver = {
60 .name = "alt_a10_pr_ip",
61 .of_match_table = alt_pr_of_match,
65 module_platform_driver(alt_pr_platform_driver);
66 MODULE_AUTHOR("Matthew Gerlach <matthew.gerlach@linux.intel.com>");
67 MODULE_DESCRIPTION("Altera Partial Reconfiguration IP Platform Driver");
68 MODULE_LICENSE("GPL v2");