Skip to content

Commit

Permalink
mtd: onenand: use dev_get_platdata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and David Woodhouse committed Aug 30, 2013
1 parent 453810b commit e09f7f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/mtd/onenand/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct onenand_info {
static int generic_onenand_probe(struct platform_device *pdev)
{
struct onenand_info *info;
struct onenand_platform_data *pdata = pdev->dev.platform_data;
struct onenand_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct resource *res = pdev->resource;
unsigned long size = resource_size(res);
int err;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/onenand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
struct resource *res;
struct mtd_part_parser_data ppdata = {};

pdata = pdev->dev.platform_data;
pdata = dev_get_platdata(&pdev->dev);
if (pdata == NULL) {
dev_err(&pdev->dev, "platform data missing\n");
return -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/onenand/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ static int s3c_onenand_probe(struct platform_device *pdev)
struct resource *r;
int size, err;

pdata = pdev->dev.platform_data;
pdata = dev_get_platdata(&pdev->dev);
/* No need to check pdata. the platform data is optional */

size = sizeof(struct mtd_info) + sizeof(struct onenand_chip);
Expand Down

0 comments on commit e09f7f9

Please sign in to comment.