]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: bcm47xxnflash: really unregister NAND on device removal
authorBrian Norris <computersforpeace@gmail.com>
Wed, 9 Dec 2015 01:04:59 +0000 (17:04 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 14 Dec 2015 18:11:09 +0000 (10:11 -0800)
commit29c5ab506468a188638fc73ae8c1bb81f0bb77bd
treee1189b714c9def12adfb5d6dc4540549583a4b55
parent03f66d07978a2a8af4fa69720b5d0857432b3166
mtd: bcm47xxnflash: really unregister NAND on device removal

The field bcma_nflash::mtd is never set to be non-zero anywhere, but we
test for it in the removal path. So the MTD is never unregistered.

Also, we should use nand_release(), not mtd_device_unregister().

Finally, we don't need to use the 'platdata' for stashing/retrieving our
*driver* data -- that's what *_{get,set}_drvdata() are for.

So, kill off bcm_nflash::mtd, and stash the struct bcm47xxnflash in
drvdata instead. Also move the forward declaration of mtd_info up a bit,
since struct bcma_sflash should be using it.

Caught while inspecting other changes being made to this driver. Compile
tested only.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/bcm47xxnflash/main.c
include/linux/bcma/bcma_driver_chipcommon.h