mtd: devices: elm: check for device's presence before configuration
authorDaniel Mack <zonque@gmail.com>
Sun, 3 Mar 2013 23:57:20 +0000 (00:57 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 5 Apr 2013 11:57:18 +0000 (12:57 +0100)
commitad2457894c272279bf73ca46ae5ea5de4876d2a0
tree11675f958813b5a7cefa1771212eaed57032acb1
parent0cca9fbf5d0a65fb536d38427f48460fda1f2e99
mtd: devices: elm: check for device's presence before configuration

In case the driver is not probed - due to config mismatches or errors
in the DTS files - dev_get_drvdata() returns NULL, leading to an Ooops
during boot.

Make elm_config() return an error in such cases to propagate the error
up to the user, so it can fall back to software mode.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/elm.c
drivers/mtd/nand/omap2.c
include/linux/platform_data/elm.h