... then we don't need to export any symbols from glue layer to musb_core. Signed-off-by: Felipe Balbi <balbi@xxxxxx> --- drivers/usb/musb/am35x.c | 4 +++- drivers/usb/musb/blackfin.c | 4 +++- drivers/usb/musb/da8xx.c | 4 +++- drivers/usb/musb/davinci.c | 4 +++- drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_core.h | 2 -- drivers/usb/musb/omap2430.c | 4 +++- drivers/usb/musb/tusb6010.c | 4 +++- include/linux/usb/musb.h | 3 +++ 9 files changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 54be6b6..9a075bf 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -530,7 +530,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) } } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops am35x_ops = { .init = am35x_platform_init, .exit = am35x_platform_exit, @@ -572,6 +572,8 @@ static int __init am35x_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &am35x_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index d8b6b6a..b2d9773 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -438,7 +438,7 @@ static int bfin_platform_exit(struct musb *musb) return 0; } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops bfin_ops = { .init = bfin_platform_init, .exit = bfin_platform_exit, @@ -481,6 +481,8 @@ static int __init bfin_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &bfin_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 1c873bc..6c11984 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -475,7 +475,7 @@ static int da8xx_platform_exit(struct musb *musb) return 0; } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops da8xx_ops = { .init = da8xx_platform_init, .exit = da8xx_platform_exit, @@ -517,6 +517,8 @@ static int __init da8xx_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &da8xx_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 679a365..5488599 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -510,7 +510,7 @@ static int davinci_platform_exit(struct musb *musb) return 0; } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops davinci_ops = { .init = davinci_platform_init, .exit = davinci_platform_exit, @@ -551,6 +551,8 @@ static int __init davinci_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &davinci_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 5a2ad95..bfd3fe9 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1903,7 +1903,6 @@ allocate_instance(struct device *dev, } musb->controller = dev; - musb->ops = &musb_ops; return musb; } @@ -2003,6 +2002,7 @@ bad_config: musb->board_set_power = plat->set_power; musb->set_clock = plat->set_clock; musb->min_power = plat->min_power; + musb->ops = plat->platform_ops; /* Clock usage is chip-specific ... functional clock (DaVinci, * OMAP2430), or PHY ref (some TUSB6010 boards). All this core diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index e07d750..5707057 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -281,8 +281,6 @@ struct musb_platform_ops { void (*set_vbus)(struct musb *musb, int on); }; -extern struct musb_platform_ops musb_ops; - /* * struct musb_hw_ep - endpoint hardware (bidirectional) * diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 85f8d42..f3df3fd 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -331,7 +331,7 @@ static int omap2430_platform_exit(struct musb *musb) return 0; } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops omap2430_ops = { .init = omap2430_platform_init, .exit = omap2430_platform_exit, @@ -376,6 +376,8 @@ static int __init omap2430_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &omap2430_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 5f90e93..24d2510 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1178,7 +1178,7 @@ static int tusb_platform_exit(struct musb *musb) return 0; } -struct musb_platform_ops musb_ops = { +static struct musb_platform_ops tusb_ops = { .init = tusb_platform_init, .exit = tusb_platform_exit, @@ -1221,6 +1221,8 @@ static int __init tusb_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &tusb_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 974b2a3..e4866c0 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -128,6 +128,9 @@ struct musb_hdrc_platform_data { /* Architecture specific board data */ void *board_data; + + /* Platform specific struct musb_ops pointer */ + void *platform_ops; }; -- 1.7.3.2.343.g7d43d -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html