]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: fix MTD suspend
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 16 Jan 2012 09:07:16 +0000 (11:07 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 30 Jan 2012 14:23:07 +0000 (14:23 +0000)
commit58dbf474a88a929aa9655106e773819510a7bcef
treea9b1dec4e9ab56faba549e7b1a1cec2cbe22b111
parentfbb308ba2c40568ad12af86d1a563eb0b2bc0f50
mtd: fix MTD suspend

Commits 4d361b5177d15282416f6253be8ef4b583399c70 and
3becb8d14c197baf8cb4fabfd5166dc89 broke MTD suspend in 2 ways:

1. When the '->suspend' method is not present, we return -EOPNOTSUPP, but
   the callers of 'mtd_suspend()' expects 0 instead.
2. Checking of the 'mtd' parameter against NULL has been incorrectly removed
   in 'mtd_cls_suspend()'.

This patch fixes the breakages. This has been found, analyzed, reported
and tested by Rafael J. Wysocki <rjw@sisk.pl>.

Note, this patch is not needed in the stable tree because it causes a
regression introduced during the v3.3 merge window.

Reported-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdcore.c
include/linux/mtd/mtd.h