From ad2457894c272279bf73ca46ae5ea5de4876d2a0 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 4 Mar 2013 00:57:20 +0100 Subject: 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 Acked-by: Peter Korsgaard Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- include/linux/platform_data/elm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/platform_data') diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h index 1bd5244d1dcd..bf0a83b7ed9d 100644 --- a/include/linux/platform_data/elm.h +++ b/include/linux/platform_data/elm.h @@ -50,5 +50,5 @@ struct elm_errorvec { void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc, struct elm_errorvec *err_vec); -void elm_config(struct device *dev, enum bch_ecc bch_type); +int elm_config(struct device *dev, enum bch_ecc bch_type); #endif /* __ELM_H */ -- cgit v1.2.1