.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for CC770 and AN82527 CAN controllers on the legacy ISA bus |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | /* |
---|
.. | .. |
---|
183 | 175 | err = -EBUSY; |
---|
184 | 176 | goto exit; |
---|
185 | 177 | } |
---|
186 | | - base = ioremap_nocache(mem[idx], iosize); |
---|
| 178 | + base = ioremap(mem[idx], iosize); |
---|
187 | 179 | if (!base) { |
---|
188 | 180 | err = -ENOMEM; |
---|
189 | 181 | goto exit_release; |
---|
.. | .. |
---|
272 | 264 | if (err) { |
---|
273 | 265 | dev_err(&pdev->dev, |
---|
274 | 266 | "couldn't register device (err=%d)\n", err); |
---|
275 | | - goto exit_unmap; |
---|
| 267 | + goto exit_free; |
---|
276 | 268 | } |
---|
277 | 269 | |
---|
278 | 270 | dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n", |
---|
279 | 271 | priv->reg_base, dev->irq); |
---|
280 | 272 | return 0; |
---|
281 | 273 | |
---|
282 | | - exit_unmap: |
---|
| 274 | +exit_free: |
---|
| 275 | + free_cc770dev(dev); |
---|
| 276 | +exit_unmap: |
---|
283 | 277 | if (mem[idx]) |
---|
284 | 278 | iounmap(base); |
---|
285 | | - exit_release: |
---|
| 279 | +exit_release: |
---|
286 | 280 | if (mem[idx]) |
---|
287 | 281 | release_mem_region(mem[idx], iosize); |
---|
288 | 282 | else |
---|
289 | 283 | release_region(port[idx], iosize); |
---|
290 | | - exit: |
---|
| 284 | +exit: |
---|
291 | 285 | return err; |
---|
292 | 286 | } |
---|
293 | 287 | |
---|