mmc: core: shut up "voltage-ranges unspecified" pr_info()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 29 Jan 2016 09:43:50 +0000 (09:43 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:03:07 +0000 (11:03 +0100)
Each time a driver such as sdhci-esdhc-imx is probed, we get a info
printk complaining that the DT voltage-ranges property has not been
specified.

However, the DT binding specifically says that the voltage-ranges
property is optional.  That means we should not be complaining that
DT hasn't specified this property: by indicating that it's optional,
it is valid not to have the property in DT.

Silence the warning if the property is missing.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c

index abd3212154d4747defe2d3ae66ca5c2ebcd0e599..a6ad78c3bb5e5c7f362968c18789b290b49a0e1e 100644 (file)
@@ -1214,8 +1214,12 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
 
        voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
        num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
-       if (!voltage_ranges || !num_ranges) {
-               pr_info("%s: voltage-ranges unspecified\n", np->full_name);
+       if (!voltage_ranges) {
+               pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
+               return -EINVAL;
+       }
+       if (!num_ranges) {
+               pr_err("%s: voltage-ranges empty\n", np->full_name);
                return -EINVAL;
        }
 
This page took 0.026028 seconds and 5 git commands to generate.