]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: cfi_cmdset_0002: do not fail on no extended query table as they are both optional
authorGuillaume LECERF <glecerf@gmail.com>
Sat, 24 Apr 2010 15:58:17 +0000 (17:58 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 14 May 2010 00:33:27 +0000 (01:33 +0100)
commitf95e2a9b37aebb8b10d0e41334c52b0cd00aa6cb
tree10f7ce02b4c0bb876c3e2c24afdb6eb0ac7707a4
parente5aa9309991277e192b0a93e8e4b13843e57396e
mtd: cfi_cmdset_0002: do not fail on no extended query table as they are both optional

After looking at AMD's CFI specification [1], both of the extended query
tables are optional. Thus, it looks like relying that at least one of
those tables exist is a bug in cfi_cmdset_0002.

This patch inverts the logic and checks for unlock function pointers before
exiting on error. This approach leaves place to add a call to a fixup
function to try to handle chips compatible with the early AMD specification
from 1995 [2].

[1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf
[2] http://noel.feld.cvut.cz/hw/amd/20158a.pdf

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/chips/cfi_cmdset_0002.c