diff options
| author | Brian Norris <computersforpeace@gmail.com> | 2015-12-08 20:04:59 -0500 |
|---|---|---|
| committer | Brian Norris <computersforpeace@gmail.com> | 2015-12-14 13:11:09 -0500 |
| commit | 665d2c2848f14c0c2a2e89192bde9073c4d352f7 (patch) | |
| tree | e1189b714c9def12adfb5d6dc4540549583a4b55 /include/linux | |
| parent | 320092a05dab2f44819c42f33d6b51efb6c474f2 (diff) | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index cf038431a5cc..db51a6ffb7d6 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -579,6 +579,8 @@ struct bcma_pflash { | |||
| 579 | }; | 579 | }; |
| 580 | 580 | ||
| 581 | #ifdef CONFIG_BCMA_SFLASH | 581 | #ifdef CONFIG_BCMA_SFLASH |
| 582 | struct mtd_info; | ||
| 583 | |||
| 582 | struct bcma_sflash { | 584 | struct bcma_sflash { |
| 583 | bool present; | 585 | bool present; |
| 584 | u32 window; | 586 | u32 window; |
| @@ -592,13 +594,9 @@ struct bcma_sflash { | |||
| 592 | #endif | 594 | #endif |
| 593 | 595 | ||
| 594 | #ifdef CONFIG_BCMA_NFLASH | 596 | #ifdef CONFIG_BCMA_NFLASH |
| 595 | struct mtd_info; | ||
| 596 | |||
| 597 | struct bcma_nflash { | 597 | struct bcma_nflash { |
| 598 | bool present; | 598 | bool present; |
| 599 | bool boot; /* This is the flash the SoC boots from */ | 599 | bool boot; /* This is the flash the SoC boots from */ |
| 600 | |||
| 601 | struct mtd_info *mtd; | ||
| 602 | }; | 600 | }; |
| 603 | #endif | 601 | #endif |
| 604 | 602 | ||
