diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-11-14 17:32:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:21 -0500 |
commit | c853b167e6ec1f25023cfc58ba2f43f9f6f5b49b (patch) | |
tree | 9212f8541b9fcf9858c88f4b15680b56fcc49bf8 /drivers/w1/masters | |
parent | 62026aedaacedbe1ffe94a3599ad4acd8ecdf587 (diff) |
drivers/w1/masters/w1-gpio.c: use dev_get_platdata()
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>
Diffstat (limited to 'drivers/w1/masters')
-rw-r--r-- | drivers/w1/masters/w1-gpio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c index 264ad1c583ab..e36b18b2817b 100644 --- a/drivers/w1/masters/w1-gpio.c +++ b/drivers/w1/masters/w1-gpio.c | |||
@@ -56,7 +56,7 @@ MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids); | |||
56 | 56 | ||
57 | static int w1_gpio_probe_dt(struct platform_device *pdev) | 57 | static int w1_gpio_probe_dt(struct platform_device *pdev) |
58 | { | 58 | { |
59 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 59 | struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
60 | struct device_node *np = pdev->dev.of_node; | 60 | struct device_node *np = pdev->dev.of_node; |
61 | int gpio; | 61 | int gpio; |
62 | 62 | ||
@@ -92,7 +92,7 @@ static int w1_gpio_probe(struct platform_device *pdev) | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | pdata = pdev->dev.platform_data; | 95 | pdata = dev_get_platdata(&pdev->dev); |
96 | 96 | ||
97 | if (!pdata) { | 97 | if (!pdata) { |
98 | dev_err(&pdev->dev, "No configuration data\n"); | 98 | dev_err(&pdev->dev, "No configuration data\n"); |
@@ -154,7 +154,7 @@ static int w1_gpio_probe(struct platform_device *pdev) | |||
154 | static int w1_gpio_remove(struct platform_device *pdev) | 154 | static int w1_gpio_remove(struct platform_device *pdev) |
155 | { | 155 | { |
156 | struct w1_bus_master *master = platform_get_drvdata(pdev); | 156 | struct w1_bus_master *master = platform_get_drvdata(pdev); |
157 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 157 | struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
158 | 158 | ||
159 | if (pdata->enable_external_pullup) | 159 | if (pdata->enable_external_pullup) |
160 | pdata->enable_external_pullup(0); | 160 | pdata->enable_external_pullup(0); |
@@ -171,7 +171,7 @@ static int w1_gpio_remove(struct platform_device *pdev) | |||
171 | 171 | ||
172 | static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) | 172 | static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) |
173 | { | 173 | { |
174 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 174 | struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
175 | 175 | ||
176 | if (pdata->enable_external_pullup) | 176 | if (pdata->enable_external_pullup) |
177 | pdata->enable_external_pullup(0); | 177 | pdata->enable_external_pullup(0); |
@@ -181,7 +181,7 @@ static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) | |||
181 | 181 | ||
182 | static int w1_gpio_resume(struct platform_device *pdev) | 182 | static int w1_gpio_resume(struct platform_device *pdev) |
183 | { | 183 | { |
184 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 184 | struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
185 | 185 | ||
186 | if (pdata->enable_external_pullup) | 186 | if (pdata->enable_external_pullup) |
187 | pdata->enable_external_pullup(1); | 187 | pdata->enable_external_pullup(1); |