Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: onenand: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Jingoo Han and committed by
David Woodhouse
e09f7f99 453810b7

+3 -3
+1 -1
drivers/mtd/onenand/generic.c
··· 38 38 static int generic_onenand_probe(struct platform_device *pdev) 39 39 { 40 40 struct onenand_info *info; 41 - struct onenand_platform_data *pdata = pdev->dev.platform_data; 41 + struct onenand_platform_data *pdata = dev_get_platdata(&pdev->dev); 42 42 struct resource *res = pdev->resource; 43 43 unsigned long size = resource_size(res); 44 44 int err;
+1 -1
drivers/mtd/onenand/omap2.c
··· 639 639 struct resource *res; 640 640 struct mtd_part_parser_data ppdata = {}; 641 641 642 - pdata = pdev->dev.platform_data; 642 + pdata = dev_get_platdata(&pdev->dev); 643 643 if (pdata == NULL) { 644 644 dev_err(&pdev->dev, "platform data missing\n"); 645 645 return -ENODEV;
+1 -1
drivers/mtd/onenand/samsung.c
··· 867 867 struct resource *r; 868 868 int size, err; 869 869 870 - pdata = pdev->dev.platform_data; 870 + pdata = dev_get_platdata(&pdev->dev); 871 871 /* No need to check pdata. the platform data is optional */ 872 872 873 873 size = sizeof(struct mtd_info) + sizeof(struct onenand_chip);