| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * CAN bus driver for the Freescale MPC5xxx embedded CPU. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2004-2005 Andrey Volkov <avolkov@varma-el.com>, |
|---|
| 5 | 6 | * Varma Electronics Oy |
|---|
| 6 | 7 | * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com> |
|---|
| 7 | | - * Copyright (C) 2009 Wolfram Sang, Pengutronix <w.sang@pengutronix.de> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the version 2 of the GNU General Public License |
|---|
| 11 | | - * as published by the Free Software Foundation |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 14 | | - * 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. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 8 | + * Copyright (C) 2009 Wolfram Sang, Pengutronix <kernel@pengutronix.de> |
|---|
| 20 | 9 | */ |
|---|
| 21 | 10 | |
|---|
| 22 | 11 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 336 | 325 | &mscan_clksrc); |
|---|
| 337 | 326 | if (!priv->can.clock.freq) { |
|---|
| 338 | 327 | dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n"); |
|---|
| 339 | | - goto exit_free_mscan; |
|---|
| 328 | + goto exit_put_clock; |
|---|
| 340 | 329 | } |
|---|
| 341 | 330 | |
|---|
| 342 | 331 | err = register_mscandev(dev, mscan_clksrc); |
|---|
| 343 | 332 | if (err) { |
|---|
| 344 | 333 | dev_err(&ofdev->dev, "registering %s failed (err=%d)\n", |
|---|
| 345 | 334 | DRV_NAME, err); |
|---|
| 346 | | - goto exit_free_mscan; |
|---|
| 335 | + goto exit_put_clock; |
|---|
| 347 | 336 | } |
|---|
| 348 | 337 | |
|---|
| 349 | 338 | dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n", |
|---|
| .. | .. |
|---|
| 351 | 340 | |
|---|
| 352 | 341 | return 0; |
|---|
| 353 | 342 | |
|---|
| 354 | | -exit_free_mscan: |
|---|
| 343 | +exit_put_clock: |
|---|
| 344 | + if (data->put_clock) |
|---|
| 345 | + data->put_clock(ofdev); |
|---|
| 355 | 346 | free_candev(dev); |
|---|
| 356 | 347 | exit_dispose_irq: |
|---|
| 357 | 348 | irq_dispose_mapping(irq); |
|---|