Commit b137aab4 authored by Brian Norris's avatar Brian Norris

mtd: physmap_of: fix set but unused warning

drivers/mtd/maps/physmap_of.c: In function ‘of_flash_probe’:
drivers/mtd/maps/physmap_of.c:165:16: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]

This could be a problem if the 'reg' property is not set, since that
means 'count' will be uninitialized.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent c3cb77f8
...@@ -186,7 +186,7 @@ static int of_flash_probe(struct platform_device *dev) ...@@ -186,7 +186,7 @@ static int of_flash_probe(struct platform_device *dev)
* consists internally of 2 non-identical NOR chips on one die. * consists internally of 2 non-identical NOR chips on one die.
*/ */
p = of_get_property(dp, "reg", &count); p = of_get_property(dp, "reg", &count);
if (count % reg_tuple_size != 0) { if (!p || count % reg_tuple_size != 0) {
dev_err(&dev->dev, "Malformed reg property on %s\n", dev_err(&dev->dev, "Malformed reg property on %s\n",
dev->dev.of_node->full_name); dev->dev.of_node->full_name);
err = -EINVAL; err = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment