From: Masahiro Yamada Date: Wed, 16 Dec 2015 01:50:26 +0000 (+0900) Subject: ARM: uniphier: allow DDR function to return more precise error code X-Git-Tag: v2016.01-rc4~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6a9f6ba0f9aec784d748d9c30dcee5cd4c2eadd5;p=oweals%2Fu-boot.git ARM: uniphier: allow DDR function to return more precise error code Return different error code depending on the reason so that the caller can know the cause of the failure. Signed-off-by: Masahiro Yamada --- diff --git a/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c b/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c index b4d369a824..4852f2dec8 100644 --- a/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c +++ b/arch/arm/mach-uniphier/ddrphy/ddrphy-training.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -117,7 +118,7 @@ int ddrphy_training(struct ddrphy __iomem *phy) if (--timeout < 0) { printf("%s: error: timeout during DDR training\n", __func__); - return -1; + return -ETIMEDOUT; } udelay(1); pgsr0 = readl(&phy->pgsr[0]); @@ -127,7 +128,7 @@ int ddrphy_training(struct ddrphy __iomem *phy) if (pgsr0 & init_sequence[i].err_flag) { printf("%s: error: %s failed\n", __func__, init_sequence[i].description); - return -1; + return -EIO; } }