mtd: rawnand: ams-delta: Check mtd_device_register() return code
authorBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 11 Nov 2018 07:55:12 +0000 (08:55 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 7 Dec 2018 09:38:25 +0000 (10:38 +0100)
commit876ba603c9e0fa7885f89a35ed221792caea8034
treed42f800cdd7d724555cbb3b8b1c5fdab88841fbf
parent8bbc3c0850d0668ac7cf0f5b129ffae8c810247f
mtd: rawnand: ams-delta: Check mtd_device_register() return code

mtd_device_register() can fail, and when it does we should propagate
the error and cleanup what has been done before.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/ams-delta.c