Commit d8ee4ea6 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman

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: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 27788c5f
...@@ -81,8 +81,9 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = { ...@@ -81,8 +81,9 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = {
}; };
#ifdef CONFIG_PM #ifdef CONFIG_PM
static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) static void omap_uart_enable_wakeup(struct device *dev, bool enable)
{ {
struct platform_device *pdev = to_platform_device(dev);
struct omap_device *od = to_omap_device(pdev); struct omap_device *od = to_omap_device(pdev);
if (!od) if (!od)
...@@ -99,15 +100,17 @@ static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) ...@@ -99,15 +100,17 @@ static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable)
* in Smartidle Mode When Configured for DMA Operations. * in Smartidle Mode When Configured for DMA Operations.
* WA: configure uart in force idle mode. * WA: configure uart in force idle mode.
*/ */
static void omap_uart_set_noidle(struct platform_device *pdev) static void omap_uart_set_noidle(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev);
struct omap_device *od = to_omap_device(pdev); struct omap_device *od = to_omap_device(pdev);
omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO); omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO);
} }
static void omap_uart_set_smartidle(struct platform_device *pdev) static void omap_uart_set_smartidle(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev);
struct omap_device *od = to_omap_device(pdev); struct omap_device *od = to_omap_device(pdev);
u8 idlemode; u8 idlemode;
...@@ -120,10 +123,10 @@ static void omap_uart_set_smartidle(struct platform_device *pdev) ...@@ -120,10 +123,10 @@ static void omap_uart_set_smartidle(struct platform_device *pdev)
} }
#else #else
static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) static void omap_uart_enable_wakeup(struct device *dev, bool enable)
{} {}
static void omap_uart_set_noidle(struct platform_device *pdev) {} static void omap_uart_set_noidle(struct device *dev) {}
static void omap_uart_set_smartidle(struct platform_device *pdev) {} static void omap_uart_set_smartidle(struct device *dev) {}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#ifdef CONFIG_OMAP_MUX #ifdef CONFIG_OMAP_MUX
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define __OMAP_SERIAL_H__ #define __OMAP_SERIAL_H__
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/platform_device.h> #include <linux/device.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <plat/mux.h> #include <plat/mux.h>
...@@ -74,9 +74,9 @@ struct omap_uart_port_info { ...@@ -74,9 +74,9 @@ struct omap_uart_port_info {
int DTR_present; int DTR_present;
int (*get_context_loss_count)(struct device *); int (*get_context_loss_count)(struct device *);
void (*set_forceidle)(struct platform_device *); void (*set_forceidle)(struct device *);
void (*set_noidle)(struct platform_device *); void (*set_noidle)(struct device *);
void (*enable_wakeup)(struct platform_device *, bool); void (*enable_wakeup)(struct device *, bool);
}; };
struct uart_omap_dma { struct uart_omap_dma {
...@@ -108,7 +108,7 @@ struct uart_omap_dma { ...@@ -108,7 +108,7 @@ struct uart_omap_dma {
struct uart_omap_port { struct uart_omap_port {
struct uart_port port; struct uart_port port;
struct uart_omap_dma uart_dma; struct uart_omap_dma uart_dma;
struct platform_device *pdev; struct device *dev;
unsigned char ier; unsigned char ier;
unsigned char lcr; unsigned char lcr;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment