.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Technologic Systems TS-73xx SBC FPGA loader |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * FPGA Manager Driver for the on-board Altera Cyclone II FPGA found on |
---|
7 | 8 | * TS-7300, heavily based on load_fpga.c in their vendor tree. |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License as published by |
---|
11 | | - * the Free Software Foundation; version 2 of the License. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | 9 | */ |
---|
18 | 10 | |
---|
19 | 11 | #include <linux/delay.h> |
---|
.. | .. |
---|
118 | 110 | struct ts73xx_fpga_priv *priv; |
---|
119 | 111 | struct fpga_manager *mgr; |
---|
120 | 112 | struct resource *res; |
---|
121 | | - int ret; |
---|
122 | 113 | |
---|
123 | 114 | priv = devm_kzalloc(kdev, sizeof(*priv), GFP_KERNEL); |
---|
124 | 115 | if (!priv) |
---|
.. | .. |
---|
128 | 119 | |
---|
129 | 120 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
130 | 121 | priv->io_base = devm_ioremap_resource(kdev, res); |
---|
131 | | - if (IS_ERR(priv->io_base)) { |
---|
132 | | - dev_err(kdev, "unable to remap registers\n"); |
---|
| 122 | + if (IS_ERR(priv->io_base)) |
---|
133 | 123 | return PTR_ERR(priv->io_base); |
---|
134 | | - } |
---|
135 | 124 | |
---|
136 | | - mgr = fpga_mgr_create(kdev, "TS-73xx FPGA Manager", |
---|
137 | | - &ts73xx_fpga_ops, priv); |
---|
| 125 | + mgr = devm_fpga_mgr_create(kdev, "TS-73xx FPGA Manager", |
---|
| 126 | + &ts73xx_fpga_ops, priv); |
---|
138 | 127 | if (!mgr) |
---|
139 | 128 | return -ENOMEM; |
---|
140 | 129 | |
---|
141 | 130 | platform_set_drvdata(pdev, mgr); |
---|
142 | 131 | |
---|
143 | | - ret = fpga_mgr_register(mgr); |
---|
144 | | - if (ret) |
---|
145 | | - fpga_mgr_free(mgr); |
---|
146 | | - |
---|
147 | | - return ret; |
---|
| 132 | + return fpga_mgr_register(mgr); |
---|
148 | 133 | } |
---|
149 | 134 | |
---|
150 | 135 | static int ts73xx_fpga_remove(struct platform_device *pdev) |
---|