hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/can/sja1000/sja1000_isa.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2009 Wolfgang Grandegger <wg@grandegger.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the version 2 of the GNU General Public License
6
- * as published by the Free Software Foundation
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
154 */
165
176 #include <linux/kernel.h>
....@@ -141,7 +130,7 @@
141130 err = -EBUSY;
142131 goto exit;
143132 }
144
- base = ioremap_nocache(mem[idx], iosize);
133
+ base = ioremap(mem[idx], iosize);
145134 if (!base) {
146135 err = -ENOMEM;
147136 goto exit_release;
....@@ -213,22 +202,24 @@
213202 if (err) {
214203 dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
215204 DRV_NAME, err);
216
- goto exit_unmap;
205
+ goto exit_free;
217206 }
218207
219208 dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n",
220209 DRV_NAME, priv->reg_base, dev->irq);
221210 return 0;
222211
223
- exit_unmap:
212
+exit_free:
213
+ free_sja1000dev(dev);
214
+exit_unmap:
224215 if (mem[idx])
225216 iounmap(base);
226
- exit_release:
217
+exit_release:
227218 if (mem[idx])
228219 release_mem_region(mem[idx], iosize);
229220 else
230221 release_region(port[idx], iosize);
231
- exit:
222
+exit:
232223 return err;
233224 }
234225