Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[platform/kernel/u-boot.git] / include / flash.h
index 1a4e879..2655c72 100644 (file)
@@ -1,8 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2000-2005
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef _FLASH_H_
@@ -45,7 +44,7 @@ typedef struct {
        uchar   sr_supported;           /* status register supported            */
        const char *name;               /* human-readable name                  */
 #endif
-#ifdef CONFIG_MTD
+#ifdef CONFIG_DM_MTD
        struct mtd_info *mtd;
 #endif
 #ifdef CONFIG_CFI_FLASH                        /* DM-specific parts */
@@ -118,6 +117,13 @@ extern int jedec_flash_match(flash_info_t *info, ulong base);
 #define CFI_CMDSET_AMD_LEGACY          0xFFF0
 #endif
 
+/**
+ * flash_perror() - Print a flash error
+ *
+ * @err: Error number of message to print (ERR_... as below)
+ */
+void flash_perror(int err);
+
 /*-----------------------------------------------------------------------
  * return codes from flash_write():
  */