diff mbox series

[v2,1/5] board: phytec: imx8m_som_detection: change phytec_imx8m_detect return type

Message ID 20231220-wip-y-moog-phytec-de-upstream_som_detection_fixes-v2-1-516abadb4f49@phytec.de
State Accepted
Commit e2be177c8511580bab3c368e8b173135471b671e
Delegated to: Fabio Estevam
Headers show
Series This series fixes various bugs in the phytec som_detection unit. | expand

Commit Message

Yannic Moog Dec. 20, 2023, 8:45 a.m. UTC
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 | 2 +-
 board/phytec/common/imx8m_som_detection.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/board/phytec/common/imx8m_som_detection.c b/board/phytec/common/imx8m_som_detection.c
index c6c96ed19cb..45f5767c565 100644
--- a/board/phytec/common/imx8m_som_detection.c
+++ b/board/phytec/common/imx8m_som_detection.c
@@ -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;
diff --git a/board/phytec/common/imx8m_som_detection.h b/board/phytec/common/imx8m_som_detection.h
index 88d3037bf36..442085cfe97 100644
--- a/board/phytec/common/imx8m_som_detection.h
+++ b/board/phytec/common/imx8m_som_detection.h
@@ -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;
 }