提交 be5e5099 编写于 作者: R Rafał Miłecki 提交者: Brian Norris

mtd: bcm47xxsflash: use platform_(set|get)_drvdata

We have generic place & helpers for storing platform driver data so
there is no reason for using custom priv pointer.

This allows cleaning up struct bcma_sflash from unneeded fields.
Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
Acked-by: NKalle Valo <kvalo@codeaurora.org>
Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 7a308bb3
...@@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) ...@@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL); b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL);
if (!b47s) if (!b47s)
return -ENOMEM; return -ENOMEM;
sflash->priv = b47s;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
...@@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) ...@@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
b47s->size = sflash->size; b47s->size = sflash->size;
bcm47xxsflash_fill_mtd(b47s, &pdev->dev); bcm47xxsflash_fill_mtd(b47s, &pdev->dev);
platform_set_drvdata(pdev, b47s);
err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0); err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0);
if (err) { if (err) {
pr_err("Failed to register MTD device: %d\n", err); pr_err("Failed to register MTD device: %d\n", err);
...@@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) ...@@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) static int bcm47xxsflash_bcma_remove(struct platform_device *pdev)
{ {
struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); struct bcm47xxsflash *b47s = platform_get_drvdata(pdev);
struct bcm47xxsflash *b47s = sflash->priv;
mtd_device_unregister(&b47s->mtd); mtd_device_unregister(&b47s->mtd);
iounmap(b47s->window); iounmap(b47s->window);
......
...@@ -593,9 +593,6 @@ struct bcma_sflash { ...@@ -593,9 +593,6 @@ struct bcma_sflash {
u32 blocksize; u32 blocksize;
u16 numblocks; u16 numblocks;
u32 size; u32 size;
struct mtd_info *mtd;
void *priv;
}; };
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册