hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/fpga/ts73xx-fpga.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Technologic Systems TS-73xx SBC FPGA loader
34 *
....@@ -5,15 +6,6 @@
56 *
67 * FPGA Manager Driver for the on-board Altera Cyclone II FPGA found on
78 * 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.
179 */
1810
1911 #include <linux/delay.h>
....@@ -118,7 +110,6 @@
118110 struct ts73xx_fpga_priv *priv;
119111 struct fpga_manager *mgr;
120112 struct resource *res;
121
- int ret;
122113
123114 priv = devm_kzalloc(kdev, sizeof(*priv), GFP_KERNEL);
124115 if (!priv)
....@@ -128,23 +119,17 @@
128119
129120 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
130121 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))
133123 return PTR_ERR(priv->io_base);
134
- }
135124
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);
138127 if (!mgr)
139128 return -ENOMEM;
140129
141130 platform_set_drvdata(pdev, mgr);
142131
143
- ret = fpga_mgr_register(mgr);
144
- if (ret)
145
- fpga_mgr_free(mgr);
146
-
147
- return ret;
132
+ return fpga_mgr_register(mgr);
148133 }
149134
150135 static int ts73xx_fpga_remove(struct platform_device *pdev)