Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: maps: physmap: Store gpio_values correctly

When the gpio-addr-flash.c driver was merged with physmap-core.c the
code to store the current gpio_values was lost. This meant that once a
gpio was asserted it was never de-asserted. Fix this by storing the
current offset in gpio_values like the old driver used to.

Fixes: commit ba32ce95cbd9 ("mtd: maps: Merge gpio-addr-flash.c into physmap-core.c")
Cc: <stable@vger.kernel.org>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Chris Packham and committed by
Richard Weinberger
64d14c6f fb899d3b

+2
+2
drivers/mtd/maps/physmap-core.c
··· 132 132 133 133 gpiod_set_value(info->gpios->desc[i], !!(BIT(i) & ofs)); 134 134 } 135 + 136 + info->gpio_values = ofs; 135 137 } 136 138 137 139 #define win_mask(order) (BIT(order) - 1)