diff options
author | Olof Johansson <olof@lixom.net> | 2015-08-13 12:27:12 (GMT) |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-08-13 12:27:12 (GMT) |
commit | 659181aedd902c080e871ba9f91bc1a714f7829d (patch) | |
tree | 2014ca0a0a95c544eb56037444f0d7d05b7aa6ff | |
parent | db553505991b0bac5d036757dcef65228951f09b (diff) | |
parent | e984a1791ac6a7c944911207e8a9c344763f0003 (diff) | |
download | linux-659181aedd902c080e871ba9f91bc1a714f7829d.tar.xz |
Merge tag 'omap-for-v4.2/fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
Fix a NULL pointer exception for omap GPMC bus code if probe fails.
* tag 'omap-for-v4.2/fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
memory: omap-gpmc: Don't try to save uninitialized GPMC context
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | drivers/memory/omap-gpmc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 3a27a84..9426276 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2245,6 +2245,9 @@ void omap3_gpmc_save_context(void) { int i; + if (!gpmc_base) + return; + gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG); gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE); gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL); @@ -2277,6 +2280,9 @@ void omap3_gpmc_restore_context(void) { int i; + if (!gpmc_base) + return; + gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig); gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable); gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl); |