|
@@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
|
|
|
b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL);
|
|
|
if (!b47s)
|
|
|
return -ENOMEM;
|
|
|
- sflash->priv = b47s;
|
|
|
|
|
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
if (!res) {
|
|
@@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
|
|
|
b47s->size = sflash->size;
|
|
|
bcm47xxsflash_fill_mtd(b47s, &pdev->dev);
|
|
|
|
|
|
+ platform_set_drvdata(pdev, b47s);
|
|
|
+
|
|
|
err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0);
|
|
|
if (err) {
|
|
|
pr_err("Failed to register MTD device: %d\n", err);
|
|
@@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(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 = sflash->priv;
|
|
|
+ struct bcm47xxsflash *b47s = platform_get_drvdata(pdev);
|
|
|
|
|
|
mtd_device_unregister(&b47s->mtd);
|
|
|
iounmap(b47s->window);
|