]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: mtdram: properly handle the phys argument in the point method
authorNicolas Pitre <nicolas.pitre@linaro.org>
Mon, 30 Oct 2017 18:48:29 +0000 (14:48 -0400)
committerRichard Weinberger <richard@nod.at>
Mon, 13 Nov 2017 20:39:17 +0000 (21:39 +0100)
commit6741ce9f7a43c3576dbedb01277db88532e87065
tree4293283747fb813bb8d59b732badf000ee36fab1
parentf0ac806fa145e36b0dab734e496e00f384da3d41
mtd: mtdram: properly handle the phys argument in the point method

When the phys pointer is non null, the point method is expected to return
the physical address for the pointed area. In the case of the mtdram
driver we have to retrieve the physical address for the corresponding
vmalloc area. However, there is no guarantee that the vmalloc area is
made of physically contiguous pages. In that case we simply limit retlen
to the actually contiguous pages.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Richard Weinberger <richard@nod.at>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/devices/mtdram.c