aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpio.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-07-21 16:48:45 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 19:35:46 -0400
commit3528c58eb9e818b7821501afa2916eb12131994a (patch)
tree078de60ef5e54b7028220c5cc58c93fe84d8e6b6 /arch/arm/mach-omap2/gpio.c
parenta2a28ad9969616fa6d7b243ecf334dc6983992cf (diff)
OMAP: omap_device: when building return platform_device instead of omap_device
All of the device init and device driver interaction with omap_device is done using platform_device pointers. To make this more explicit, have omap_device return a platform_device pointer instead of an omap_device pointer. All current users of the omap_device pointer were only using it to get at the platform_device pointer or struct device pointer, so fixing all of the users was trivial. This also makes it more difficult for device init code to directly access members of struct omap_device, and allows for easier changing of omap_device internals. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpio.c')
-rw-r--r--arch/arm/mach-omap2/gpio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 2765cdc3152d..76abdcb6e0b0 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -34,7 +34,7 @@ static struct omap_device_pm_latency omap_gpio_latency[] = {
34 34
35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) 35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
36{ 36{
37 struct omap_device *od; 37 struct platform_device *pdev;
38 struct omap_gpio_platform_data *pdata; 38 struct omap_gpio_platform_data *pdata;
39 struct omap_gpio_dev_attr *dev_attr; 39 struct omap_gpio_dev_attr *dev_attr;
40 char *name = "omap_gpio"; 40 char *name = "omap_gpio";
@@ -107,16 +107,16 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
107 return -EINVAL; 107 return -EINVAL;
108 } 108 }
109 109
110 od = omap_device_build(name, id - 1, oh, pdata, 110 pdev = omap_device_build(name, id - 1, oh, pdata,
111 sizeof(*pdata), omap_gpio_latency, 111 sizeof(*pdata), omap_gpio_latency,
112 ARRAY_SIZE(omap_gpio_latency), 112 ARRAY_SIZE(omap_gpio_latency),
113 false); 113 false);
114 kfree(pdata); 114 kfree(pdata);
115 115
116 if (IS_ERR(od)) { 116 if (IS_ERR(pdev)) {
117 WARN(1, "Can't build omap_device for %s:%s.\n", 117 WARN(1, "Can't build omap_device for %s:%s.\n",
118 name, oh->name); 118 name, oh->name);
119 return PTR_ERR(od); 119 return PTR_ERR(pdev);
120 } 120 }
121 121
122 omap_device_disable_idle_on_suspend(od); 122 omap_device_disable_idle_on_suspend(od);