ARM: mmp: Fix failure to remove sram device
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 26 Jul 2021 20:01:58 +0000 (22:01 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 25 Feb 2022 15:38:34 +0000 (16:38 +0100)
commit4036b29a146b2749af3bb213b003eb69f3e5ecc4
treeef7e9da318c4d99a05a8483e08b6a1c197779926
parent022e5220f2721d00610c0bf2926e8baa4e5fb4e2
ARM: mmp: Fix failure to remove sram device

Make sure in .probe() to set driver data before the function is left to
make it possible in .remove() to undo the actions done.

This fixes a potential memory leak and stops returning an error code in
.remove() that is ignored by the driver core anyhow.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-mmp/sram.c