hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/mtd/devices/st_spi_fsm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * st_spi_fsm.c - ST Fast Sequence Mode (FSM) Serial Flash Controller
34 *
....@@ -6,11 +7,6 @@
67 * Copyright (C) 2010-2014 STMicroelectronics Limited
78 *
89 * 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
- *
1410 */
1511 #include <linux/kernel.h>
1612 #include <linux/module.h>
....@@ -259,7 +255,6 @@
259255 struct stfsm {
260256 struct device *dev;
261257 void __iomem *base;
262
- struct resource *region;
263258 struct mtd_info mtd;
264259 struct mutex lock;
265260 struct flash_info *info;
....@@ -2120,10 +2115,12 @@
21202115 (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
21212116 fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
21222117
2123
- return mtd_device_register(&fsm->mtd, NULL, 0);
2124
-
2118
+ ret = mtd_device_register(&fsm->mtd, NULL, 0);
2119
+ if (ret) {
21252120 err_clk_unprepare:
2126
- clk_disable_unprepare(fsm->clk);
2121
+ clk_disable_unprepare(fsm->clk);
2122
+ }
2123
+
21272124 return ret;
21282125 }
21292126