]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: bcm47xxsflash: use platform_(set|get)_drvdata
authorRafał Miłecki <rafal@milecki.pl>
Mon, 16 Jan 2017 16:28:18 +0000 (17:28 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 8 Feb 2017 19:19:43 +0000 (11:19 -0800)
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: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/devices/bcm47xxsflash.c
include/linux/bcma/bcma_driver_chipcommon.h

index 514be04c0b6cc64962c1c4a4b2947346c5fa05dd..4decd8c0360a91c5ccf6bcb2648dbed07464e341 100644 (file)
@@ -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);
index b20e3d56253f6ef0660fd5a35c4b2f7932a6f8ad..2f1c690a3e6622a5b79fa2486854574788083c24 100644 (file)
@@ -593,9 +593,6 @@ struct bcma_sflash {
        u32 blocksize;
        u16 numblocks;
        u32 size;
-
-       struct mtd_info *mtd;
-       void *priv;
 };
 #endif