forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/can/cc770/cc770_isa.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for CC770 and AN82527 CAN controllers on the legacy ISA bus
34 *
45 * Copyright (C) 2009, 2011 Wolfgang Grandegger <wg@grandegger.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the version 2 of the GNU General Public License
8
- * as published by the Free Software Foundation
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 /*
....@@ -183,7 +175,7 @@
183175 err = -EBUSY;
184176 goto exit;
185177 }
186
- base = ioremap_nocache(mem[idx], iosize);
178
+ base = ioremap(mem[idx], iosize);
187179 if (!base) {
188180 err = -ENOMEM;
189181 goto exit_release;
....@@ -272,22 +264,24 @@
272264 if (err) {
273265 dev_err(&pdev->dev,
274266 "couldn't register device (err=%d)\n", err);
275
- goto exit_unmap;
267
+ goto exit_free;
276268 }
277269
278270 dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n",
279271 priv->reg_base, dev->irq);
280272 return 0;
281273
282
- exit_unmap:
274
+exit_free:
275
+ free_cc770dev(dev);
276
+exit_unmap:
283277 if (mem[idx])
284278 iounmap(base);
285
- exit_release:
279
+exit_release:
286280 if (mem[idx])
287281 release_mem_region(mem[idx], iosize);
288282 else
289283 release_region(port[idx], iosize);
290
- exit:
284
+exit:
291285 return err;
292286 }
293287