| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 141 | 130 | err = -EBUSY; |
|---|
| 142 | 131 | goto exit; |
|---|
| 143 | 132 | } |
|---|
| 144 | | - base = ioremap_nocache(mem[idx], iosize); |
|---|
| 133 | + base = ioremap(mem[idx], iosize); |
|---|
| 145 | 134 | if (!base) { |
|---|
| 146 | 135 | err = -ENOMEM; |
|---|
| 147 | 136 | goto exit_release; |
|---|
| .. | .. |
|---|
| 213 | 202 | if (err) { |
|---|
| 214 | 203 | dev_err(&pdev->dev, "registering %s failed (err=%d)\n", |
|---|
| 215 | 204 | DRV_NAME, err); |
|---|
| 216 | | - goto exit_unmap; |
|---|
| 205 | + goto exit_free; |
|---|
| 217 | 206 | } |
|---|
| 218 | 207 | |
|---|
| 219 | 208 | dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n", |
|---|
| 220 | 209 | DRV_NAME, priv->reg_base, dev->irq); |
|---|
| 221 | 210 | return 0; |
|---|
| 222 | 211 | |
|---|
| 223 | | - exit_unmap: |
|---|
| 212 | +exit_free: |
|---|
| 213 | + free_sja1000dev(dev); |
|---|
| 214 | +exit_unmap: |
|---|
| 224 | 215 | if (mem[idx]) |
|---|
| 225 | 216 | iounmap(base); |
|---|
| 226 | | - exit_release: |
|---|
| 217 | +exit_release: |
|---|
| 227 | 218 | if (mem[idx]) |
|---|
| 228 | 219 | release_mem_region(mem[idx], iosize); |
|---|
| 229 | 220 | else |
|---|
| 230 | 221 | release_region(port[idx], iosize); |
|---|
| 231 | | - exit: |
|---|
| 222 | +exit: |
|---|
| 232 | 223 | return err; |
|---|
| 233 | 224 | } |
|---|
| 234 | 225 | |
|---|