]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: nand-gpio: don't waste memory for OF failure
authorBrian Norris <computersforpeace@gmail.com>
Sat, 14 Dec 2013 05:19:58 +0000 (21:19 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 3 Jan 2014 19:37:20 +0000 (11:37 -0800)
commitb68f64e29810909f13c40339e212a4c7b09ece4f
tree989ce95429095a3a4ea6452b110a859d88b4b7f9
parentb4512a1b0602dd134851d14b95c208f52d6c8beb
mtd: nand-gpio: don't waste memory for OF failure

We shouldn't try to allocate a resource until we're sure the
of_property_read_u64() call didn't fail. This is especially important if
we use this code for both CONFIG_OF and !CONFIG_OF builds, since
of_property_read_u64() will always return -ENOSYS for !CONFIG_OF.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/gpio.c