hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/mtd/lpddr/lpddr2_nvm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * LPDDR2-NVM MTD driver. This module provides read, write, erase, lock/unlock
34 * support for LPDDR2-NVM PCM memories
....@@ -7,16 +8,6 @@
78 * Vincenzo Aliberti <vincenzo.aliberti@gmail.com>
89 * Domenico Manna <domenico.manna@gmail.com>
910 * Many thanks to Andrea Vigilante for initial enabling
10
- *
11
- * This program is free software; you can redistribute it and/or
12
- * modify it under the terms of the GNU General Public License
13
- * as published by the Free Software Foundation; either version 2
14
- * of the License, or (at your option) any later version.
15
- *
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU General Public License for more details.
2011 */
2112
2213 #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
....@@ -442,6 +433,8 @@
442433
443434 /* lpddr2_nvm address range */
444435 add_range = platform_get_resource(pdev, IORESOURCE_MEM, 0);
436
+ if (!add_range)
437
+ return -ENODEV;
445438
446439 /* Populate map_info data structure */
447440 *map = (struct map_info) {