mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
mtd: maps: physmap: Leave assigned complex mappings
SoC-specific drivers might provide their own map->xxx() implementations, and calling simple_map_init() unconditionally will override those implementations. Make sure map->read is NULL before calling simple_map_init(). Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
c78f59d714
commit
b3dd93030c
@ -514,10 +514,20 @@ static int physmap_flash_probe(struct platform_device *dev)
|
||||
err = physmap_addr_gpios_map_init(&info->maps[i]);
|
||||
if (err)
|
||||
goto err_out;
|
||||
} else {
|
||||
simple_map_init(&info->maps[i]);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
|
||||
/*
|
||||
* Only use the simple_map implementation if map hooks are not
|
||||
* implemented. Since map->read() is mandatory checking for its
|
||||
* presence is enough.
|
||||
*/
|
||||
if (!info->maps[i].read)
|
||||
simple_map_init(&info->maps[i]);
|
||||
#else
|
||||
simple_map_init(&info->maps[i]);
|
||||
#endif
|
||||
|
||||
if (info->probe_type) {
|
||||
info->mtds[i] = do_map_probe(info->probe_type,
|
||||
&info->maps[i]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user