]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: phytec: imx8m_som_detection: change phytec_imx8m_detect return type
authorYannic Moog <y.moog@phytec.de>
Wed, 20 Dec 2023 08:45:32 +0000 (09:45 +0100)
committerFabio Estevam <festevam@denx.de>
Wed, 20 Dec 2023 18:04:46 +0000 (15:04 -0300)
phytec_imx8m_detect returns -1 on error, but the return type is u8
leading to 255 return values. Fix this by changing the return type to
int; there is no reason to keep it as u8 .

Signed-off-by: Yannic Moog <y.moog@phytec.de>
board/phytec/common/imx8m_som_detection.c
board/phytec/common/imx8m_som_detection.h

index c6c96ed19cb32012c748f7a0c60348ee93d352cd..45f5767c565e64df24dd89aef79cba71f7d65625 100644 (file)
@@ -23,7 +23,7 @@ extern struct phytec_eeprom_data eeprom_data;
  *
  * Returns 0 in case it's a known SoM. Otherwise, returns -1.
  */
-u8 __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data)
+int __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data)
 {
        char *opt;
        u8 som;
index 88d3037bf363e8451ce58579891d2e0cf20a812b..442085cfe97188db0cd6b3b465e45cbff040c4fb 100644 (file)
@@ -15,7 +15,7 @@
 
 #if IS_ENABLED(CONFIG_PHYTEC_IMX8M_SOM_DETECTION)
 
-u8 __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data);
+int __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data);
 u8 __maybe_unused phytec_get_imx8m_ddr_size(struct phytec_eeprom_data *data);
 u8 __maybe_unused phytec_get_imx8mp_rtc(struct phytec_eeprom_data *data);
 u8 __maybe_unused phytec_get_imx8m_spi(struct phytec_eeprom_data *data);
@@ -23,7 +23,7 @@ u8 __maybe_unused phytec_get_imx8m_eth(struct phytec_eeprom_data *data);
 
 #else
 
-inline u8 __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data)
+inline int __maybe_unused phytec_imx8m_detect(struct phytec_eeprom_data *data)
 {
        return -1;
 }