Commit c1a7d67c authored by Jingoo Han's avatar Jingoo Han Committed by Felipe Balbi

usb: musb: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 19f9e188
...@@ -218,7 +218,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci) ...@@ -218,7 +218,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
struct musb *musb = hci; struct musb *musb = hci;
void __iomem *reg_base = musb->ctrl_base; void __iomem *reg_base = musb->ctrl_base;
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
struct usb_otg *otg = musb->xceiv->otg; struct usb_otg *otg = musb->xceiv->otg;
unsigned long flags; unsigned long flags;
...@@ -335,7 +335,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci) ...@@ -335,7 +335,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode) static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode)
{ {
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
int retval = 0; int retval = 0;
...@@ -350,7 +350,7 @@ static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode) ...@@ -350,7 +350,7 @@ static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode)
static int am35x_musb_init(struct musb *musb) static int am35x_musb_init(struct musb *musb)
{ {
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
void __iomem *reg_base = musb->ctrl_base; void __iomem *reg_base = musb->ctrl_base;
u32 rev; u32 rev;
...@@ -394,7 +394,7 @@ static int am35x_musb_init(struct musb *musb) ...@@ -394,7 +394,7 @@ static int am35x_musb_init(struct musb *musb)
static int am35x_musb_exit(struct musb *musb) static int am35x_musb_exit(struct musb *musb)
{ {
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
del_timer_sync(&otg_workaround); del_timer_sync(&otg_workaround);
...@@ -456,7 +456,7 @@ static u64 am35x_dmamask = DMA_BIT_MASK(32); ...@@ -456,7 +456,7 @@ static u64 am35x_dmamask = DMA_BIT_MASK(32);
static int am35x_probe(struct platform_device *pdev) static int am35x_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct platform_device *musb; struct platform_device *musb;
struct am35x_glue *glue; struct am35x_glue *glue;
...@@ -577,7 +577,7 @@ static int am35x_remove(struct platform_device *pdev) ...@@ -577,7 +577,7 @@ static int am35x_remove(struct platform_device *pdev)
static int am35x_suspend(struct device *dev) static int am35x_suspend(struct device *dev)
{ {
struct am35x_glue *glue = dev_get_drvdata(dev); struct am35x_glue *glue = dev_get_drvdata(dev);
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
/* Shutdown the on-chip PHY and its PLL. */ /* Shutdown the on-chip PHY and its PLL. */
...@@ -593,7 +593,7 @@ static int am35x_suspend(struct device *dev) ...@@ -593,7 +593,7 @@ static int am35x_suspend(struct device *dev)
static int am35x_resume(struct device *dev) static int am35x_resume(struct device *dev)
{ {
struct am35x_glue *glue = dev_get_drvdata(dev); struct am35x_glue *glue = dev_get_drvdata(dev);
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
int ret; int ret;
......
...@@ -451,7 +451,7 @@ static u64 bfin_dmamask = DMA_BIT_MASK(32); ...@@ -451,7 +451,7 @@ static u64 bfin_dmamask = DMA_BIT_MASK(32);
static int bfin_probe(struct platform_device *pdev) static int bfin_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct platform_device *musb; struct platform_device *musb;
struct bfin_glue *glue; struct bfin_glue *glue;
......
...@@ -477,7 +477,7 @@ static u64 da8xx_dmamask = DMA_BIT_MASK(32); ...@@ -477,7 +477,7 @@ static u64 da8xx_dmamask = DMA_BIT_MASK(32);
static int da8xx_probe(struct platform_device *pdev) static int da8xx_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct platform_device *musb; struct platform_device *musb;
struct da8xx_glue *glue; struct da8xx_glue *glue;
......
...@@ -510,7 +510,7 @@ static u64 davinci_dmamask = DMA_BIT_MASK(32); ...@@ -510,7 +510,7 @@ static u64 davinci_dmamask = DMA_BIT_MASK(32);
static int davinci_probe(struct platform_device *pdev) static int davinci_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct platform_device *musb; struct platform_device *musb;
struct davinci_glue *glue; struct davinci_glue *glue;
struct clk *clk; struct clk *clk;
......
...@@ -1783,7 +1783,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -1783,7 +1783,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
{ {
int status; int status;
struct musb *musb; struct musb *musb;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
/* The driver might handle more features than the board; OK. /* The driver might handle more features than the board; OK.
* Fail when the board needs a feature that's not enabled. * Fail when the board needs a feature that's not enabled.
......
...@@ -478,7 +478,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id) ...@@ -478,7 +478,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
{ {
struct device *dev = glue->dev; struct device *dev = glue->dev;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct musb_hdrc_platform_data *pdata = dev->platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(dev);
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct musb_hdrc_config *config; struct musb_hdrc_config *config;
struct platform_device *musb; struct platform_device *musb;
......
...@@ -255,7 +255,7 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) ...@@ -255,7 +255,7 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
{ {
struct musb *musb = glue_to_musb(glue); struct musb *musb = glue_to_musb(glue);
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *pdata = dev->platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(dev);
struct omap_musb_board_data *data = pdata->board_data; struct omap_musb_board_data *data = pdata->board_data;
struct usb_otg *otg = musb->xceiv->otg; struct usb_otg *otg = musb->xceiv->otg;
...@@ -341,7 +341,7 @@ static int omap2430_musb_init(struct musb *musb) ...@@ -341,7 +341,7 @@ static int omap2430_musb_init(struct musb *musb)
int status = 0; int status = 0;
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct omap2430_glue *glue = dev_get_drvdata(dev->parent); struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct omap_musb_board_data *data = plat->board_data; struct omap_musb_board_data *data = plat->board_data;
/* We require some kind of external transceiver, hooked /* We require some kind of external transceiver, hooked
...@@ -412,7 +412,7 @@ static void omap2430_musb_enable(struct musb *musb) ...@@ -412,7 +412,7 @@ static void omap2430_musb_enable(struct musb *musb)
unsigned long timeout = jiffies + msecs_to_jiffies(1000); unsigned long timeout = jiffies + msecs_to_jiffies(1000);
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct omap2430_glue *glue = dev_get_drvdata(dev->parent); struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
struct musb_hdrc_platform_data *pdata = dev->platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(dev);
struct omap_musb_board_data *data = pdata->board_data; struct omap_musb_board_data *data = pdata->board_data;
switch (glue->status) { switch (glue->status) {
...@@ -482,7 +482,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32); ...@@ -482,7 +482,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32);
static int omap2430_probe(struct platform_device *pdev) static int omap2430_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct omap_musb_board_data *data; struct omap_musb_board_data *data;
struct platform_device *musb; struct platform_device *musb;
struct omap2430_glue *glue; struct omap2430_glue *glue;
......
...@@ -1157,7 +1157,7 @@ static u64 tusb_dmamask = DMA_BIT_MASK(32); ...@@ -1157,7 +1157,7 @@ static u64 tusb_dmamask = DMA_BIT_MASK(32);
static int tusb_probe(struct platform_device *pdev) static int tusb_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct platform_device *musb; struct platform_device *musb;
struct tusb6010_glue *glue; struct tusb6010_glue *glue;
......
...@@ -227,7 +227,7 @@ ux500_of_probe(struct platform_device *pdev, struct device_node *np) ...@@ -227,7 +227,7 @@ ux500_of_probe(struct platform_device *pdev, struct device_node *np)
static int ux500_probe(struct platform_device *pdev) static int ux500_probe(struct platform_device *pdev)
{ {
struct resource musb_resources[2]; struct resource musb_resources[2];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct platform_device *musb; struct platform_device *musb;
struct ux500_glue *glue; struct ux500_glue *glue;
......
...@@ -286,7 +286,7 @@ static int ux500_dma_controller_start(struct ux500_dma_controller *controller) ...@@ -286,7 +286,7 @@ static int ux500_dma_controller_start(struct ux500_dma_controller *controller)
struct ux500_dma_channel *ux500_channel = NULL; struct ux500_dma_channel *ux500_channel = NULL;
struct musb *musb = controller->private_data; struct musb *musb = controller->private_data;
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data; struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
struct ux500_musb_board_data *data; struct ux500_musb_board_data *data;
struct dma_channel *dma_channel = NULL; struct dma_channel *dma_channel = NULL;
char **chan_names; char **chan_names;
......
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