.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * st_spi_fsm.c - ST Fast Sequence Mode (FSM) Serial Flash Controller |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Copyright (C) 2010-2014 STMicroelectronics Limited |
---|
7 | 8 | * |
---|
8 | 9 | * JEDEC probe based on drivers/mtd/devices/m25p80.c |
---|
9 | | - * |
---|
10 | | - * This code is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of the GNU General Public License version 2 as |
---|
12 | | - * published by the Free Software Foundation. |
---|
13 | | - * |
---|
14 | 10 | */ |
---|
15 | 11 | #include <linux/kernel.h> |
---|
16 | 12 | #include <linux/module.h> |
---|
.. | .. |
---|
259 | 255 | struct stfsm { |
---|
260 | 256 | struct device *dev; |
---|
261 | 257 | void __iomem *base; |
---|
262 | | - struct resource *region; |
---|
263 | 258 | struct mtd_info mtd; |
---|
264 | 259 | struct mutex lock; |
---|
265 | 260 | struct flash_info *info; |
---|
.. | .. |
---|
2120 | 2115 | (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20), |
---|
2121 | 2116 | fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10)); |
---|
2122 | 2117 | |
---|
2123 | | - return mtd_device_register(&fsm->mtd, NULL, 0); |
---|
2124 | | - |
---|
| 2118 | + ret = mtd_device_register(&fsm->mtd, NULL, 0); |
---|
| 2119 | + if (ret) { |
---|
2125 | 2120 | err_clk_unprepare: |
---|
2126 | | - clk_disable_unprepare(fsm->clk); |
---|
| 2121 | + clk_disable_unprepare(fsm->clk); |
---|
| 2122 | + } |
---|
| 2123 | + |
---|
2127 | 2124 | return ret; |
---|
2128 | 2125 | } |
---|
2129 | 2126 | |
---|