]> git.sur5r.net Git - u-boot/commitdiff
mmc: let mmc_of_parse() fail for insane bus-width value
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 29 Dec 2017 17:00:07 +0000 (02:00 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 22 Jan 2018 05:11:58 +0000 (14:11 +0900)
You must fix your DT if it specifies insane bus-width, for example,
  bus-width = <3>;

debug() is not displayed in usual configuration, so people will not
even notice weirdness.  Use dev_err() instead, then let it fail.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/mmc-uclass.c

index 7910a3e278da785c6b53b0819742112d98fd0de8..a3536b15ae677596c403b01e8a805d0f6df65061 100644 (file)
@@ -140,10 +140,8 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
                cfg->host_caps |= MMC_MODE_1BIT;
                break;
        default:
-               debug("warning: %s invalid bus-width property. using 1-bit\n",
-                     dev_read_name(dev));
-               cfg->host_caps |= MMC_MODE_1BIT;
-               break;
+               dev_err(dev, "Invalid \"bus-width\" value %u!\n", val);
+               return -EINVAL;
        }
 
        /* f_max is obtained from the optional "max-frequency" property */