Skip to content

Commit

Permalink
drivers/w1/masters/w1-gpio.c: 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.  This is a cosmetic change to make
the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed Nov 15, 2013
1 parent 62026ae commit c853b16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/w1/masters/w1-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids);

static int w1_gpio_probe_dt(struct platform_device *pdev)
{
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *np = pdev->dev.of_node;
int gpio;

Expand Down Expand Up @@ -92,7 +92,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
}
}

pdata = pdev->dev.platform_data;
pdata = dev_get_platdata(&pdev->dev);

if (!pdata) {
dev_err(&pdev->dev, "No configuration data\n");
Expand Down Expand Up @@ -154,7 +154,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
static int w1_gpio_remove(struct platform_device *pdev)
{
struct w1_bus_master *master = platform_get_drvdata(pdev);
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);

if (pdata->enable_external_pullup)
pdata->enable_external_pullup(0);
Expand All @@ -171,7 +171,7 @@ static int w1_gpio_remove(struct platform_device *pdev)

static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state)
{
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);

if (pdata->enable_external_pullup)
pdata->enable_external_pullup(0);
Expand All @@ -181,7 +181,7 @@ static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state)

static int w1_gpio_resume(struct platform_device *pdev)
{
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);

if (pdata->enable_external_pullup)
pdata->enable_external_pullup(1);
Expand Down

0 comments on commit c853b16

Please sign in to comment.