Skip to content
Commit 76fe334f authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Boris Brezillon
Browse files

mtd: nand: Error out if cmd_ctrl() is missing



If no user specified chip->select_chip() function is provided, code in
nand_base.c will automatically set this hook to nand_select_chip(),
which in turn depends on chip->cmd_ctrl() hook being valid. Not
providing both of those functions in NAND controller driver (for example
by mistake) will result in a bit cryptic segfault. Same is true for
chip->cmdfunc().

To avoid the above scenario add a check in nand_scan_dent and error out
if cmd_ctrl() is not provided.

Suggested-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Suggested-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 75c19e58
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment