aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-09-06 08:45:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-06 12:17:00 -0400
commitd8ee4ea68ff9c0f13646070aeada668a4eae9189 (patch)
tree92f05de31dc45bb4e5f799f5d4b0fa59b475def1 /arch/arm
parent27788c5fe6af98c34950326b62778da15e30eb55 (diff)
serial: omap: don't access the platform_device
The driver doesn't need to know about its platform_device. Everything the driver needs can be done through the struct device pointer. In case we need to use the OMAP-specific PM function pointers, those can make sure to find the device's platform_device pointer so they can find the struct omap_device through pdev->archdata field. Tested-by: Shubhrajyoti D <shubhrajyoti@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/serial.c15
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h10
2 files changed, 14 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 25d53b2800c1..9e80d209d138 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -81,8 +81,9 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = {
81}; 81};
82 82
83#ifdef CONFIG_PM 83#ifdef CONFIG_PM
84static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) 84static void omap_uart_enable_wakeup(struct device *dev, bool enable)
85{ 85{
86 struct platform_device *pdev = to_platform_device(dev);
86 struct omap_device *od = to_omap_device(pdev); 87 struct omap_device *od = to_omap_device(pdev);
87 88
88 if (!od) 89 if (!od)
@@ -99,15 +100,17 @@ static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable)
99 * in Smartidle Mode When Configured for DMA Operations. 100 * in Smartidle Mode When Configured for DMA Operations.
100 * WA: configure uart in force idle mode. 101 * WA: configure uart in force idle mode.
101 */ 102 */
102static void omap_uart_set_noidle(struct platform_device *pdev) 103static void omap_uart_set_noidle(struct device *dev)
103{ 104{
105 struct platform_device *pdev = to_platform_device(dev);
104 struct omap_device *od = to_omap_device(pdev); 106 struct omap_device *od = to_omap_device(pdev);
105 107
106 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO); 108 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO);
107} 109}
108 110
109static void omap_uart_set_smartidle(struct platform_device *pdev) 111static void omap_uart_set_smartidle(struct device *dev)
110{ 112{
113 struct platform_device *pdev = to_platform_device(dev);
111 struct omap_device *od = to_omap_device(pdev); 114 struct omap_device *od = to_omap_device(pdev);
112 u8 idlemode; 115 u8 idlemode;
113 116
@@ -120,10 +123,10 @@ static void omap_uart_set_smartidle(struct platform_device *pdev)
120} 123}
121 124
122#else 125#else
123static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) 126static void omap_uart_enable_wakeup(struct device *dev, bool enable)
124{} 127{}
125static void omap_uart_set_noidle(struct platform_device *pdev) {} 128static void omap_uart_set_noidle(struct device *dev) {}
126static void omap_uart_set_smartidle(struct platform_device *pdev) {} 129static void omap_uart_set_smartidle(struct device *dev) {}
127#endif /* CONFIG_PM */ 130#endif /* CONFIG_PM */
128 131
129#ifdef CONFIG_OMAP_MUX 132#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 5cc062620719..90d2d74d1682 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -18,7 +18,7 @@
18#define __OMAP_SERIAL_H__ 18#define __OMAP_SERIAL_H__
19 19
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/platform_device.h> 21#include <linux/device.h>
22#include <linux/pm_qos.h> 22#include <linux/pm_qos.h>
23 23
24#include <plat/mux.h> 24#include <plat/mux.h>
@@ -74,9 +74,9 @@ struct omap_uart_port_info {
74 int DTR_present; 74 int DTR_present;
75 75
76 int (*get_context_loss_count)(struct device *); 76 int (*get_context_loss_count)(struct device *);
77 void (*set_forceidle)(struct platform_device *); 77 void (*set_forceidle)(struct device *);
78 void (*set_noidle)(struct platform_device *); 78 void (*set_noidle)(struct device *);
79 void (*enable_wakeup)(struct platform_device *, bool); 79 void (*enable_wakeup)(struct device *, bool);
80}; 80};
81 81
82struct uart_omap_dma { 82struct uart_omap_dma {
@@ -108,7 +108,7 @@ struct uart_omap_dma {
108struct uart_omap_port { 108struct uart_omap_port {
109 struct uart_port port; 109 struct uart_port port;
110 struct uart_omap_dma uart_dma; 110 struct uart_omap_dma uart_dma;
111 struct platform_device *pdev; 111 struct device *dev;
112 112
113 unsigned char ier; 113 unsigned char ier;
114 unsigned char lcr; 114 unsigned char lcr;