提交 e9e8c85e 编写于 作者: F Felipe Balbi

usb: musb: make modules behave better

There's really no point in doing all that
initcall trickery when we can safely let
udev handle module probing for us.

Remove all of that trickery, by moving everybody
to module_init() and making proper use of
platform_device_register() rather than
platform_device_probe().
Tested-by: NRajashekhara, Sudhakar <sudhakar.raj@ti.com>
Tested-by: NTasslehoff Kjappfot <tasskjapp@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 f5579787
...@@ -456,7 +456,7 @@ static const struct musb_platform_ops am35x_ops = { ...@@ -456,7 +456,7 @@ static const struct musb_platform_ops am35x_ops = {
static u64 am35x_dmamask = DMA_BIT_MASK(32); static u64 am35x_dmamask = DMA_BIT_MASK(32);
static int __init am35x_probe(struct platform_device *pdev) static int __devinit am35x_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -561,7 +561,7 @@ static int __init am35x_probe(struct platform_device *pdev) ...@@ -561,7 +561,7 @@ static int __init am35x_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit am35x_remove(struct platform_device *pdev) static int __devexit am35x_remove(struct platform_device *pdev)
{ {
struct am35x_glue *glue = platform_get_drvdata(pdev); struct am35x_glue *glue = platform_get_drvdata(pdev);
...@@ -630,7 +630,8 @@ static struct dev_pm_ops am35x_pm_ops = { ...@@ -630,7 +630,8 @@ static struct dev_pm_ops am35x_pm_ops = {
#endif #endif
static struct platform_driver am35x_driver = { static struct platform_driver am35x_driver = {
.remove = __exit_p(am35x_remove), .probe = am35x_probe,
.remove = __devexit_p(am35x_remove),
.driver = { .driver = {
.name = "musb-am35x", .name = "musb-am35x",
.pm = DEV_PM_OPS, .pm = DEV_PM_OPS,
...@@ -643,9 +644,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -643,9 +644,9 @@ MODULE_LICENSE("GPL v2");
static int __init am35x_init(void) static int __init am35x_init(void)
{ {
return platform_driver_probe(&am35x_driver, am35x_probe); return platform_driver_register(&am35x_driver);
} }
subsys_initcall(am35x_init); module_init(am35x_init);
static void __exit am35x_exit(void) static void __exit am35x_exit(void)
{ {
......
...@@ -463,7 +463,7 @@ static const struct musb_platform_ops bfin_ops = { ...@@ -463,7 +463,7 @@ static const struct musb_platform_ops bfin_ops = {
static u64 bfin_dmamask = DMA_BIT_MASK(32); static u64 bfin_dmamask = DMA_BIT_MASK(32);
static int __init bfin_probe(struct platform_device *pdev) static int __devinit bfin_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -525,7 +525,7 @@ static int __init bfin_probe(struct platform_device *pdev) ...@@ -525,7 +525,7 @@ static int __init bfin_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit bfin_remove(struct platform_device *pdev) static int __devexit bfin_remove(struct platform_device *pdev)
{ {
struct bfin_glue *glue = platform_get_drvdata(pdev); struct bfin_glue *glue = platform_get_drvdata(pdev);
...@@ -575,6 +575,7 @@ static struct dev_pm_ops bfin_pm_ops = { ...@@ -575,6 +575,7 @@ static struct dev_pm_ops bfin_pm_ops = {
#endif #endif
static struct platform_driver bfin_driver = { static struct platform_driver bfin_driver = {
.probe = bfin_probe,
.remove = __exit_p(bfin_remove), .remove = __exit_p(bfin_remove),
.driver = { .driver = {
.name = "musb-blackfin", .name = "musb-blackfin",
...@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2");
static int __init bfin_init(void) static int __init bfin_init(void)
{ {
return platform_driver_probe(&bfin_driver, bfin_probe); return platform_driver_register(&bfin_driver);
} }
subsys_initcall(bfin_init); module_init(bfin_init);
static void __exit bfin_exit(void) static void __exit bfin_exit(void)
{ {
......
...@@ -478,7 +478,7 @@ static const struct musb_platform_ops da8xx_ops = { ...@@ -478,7 +478,7 @@ static const struct musb_platform_ops da8xx_ops = {
static u64 da8xx_dmamask = DMA_BIT_MASK(32); static u64 da8xx_dmamask = DMA_BIT_MASK(32);
static int __init da8xx_probe(struct platform_device *pdev) static int __devinit da8xx_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -562,7 +562,7 @@ static int __init da8xx_probe(struct platform_device *pdev) ...@@ -562,7 +562,7 @@ static int __init da8xx_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit da8xx_remove(struct platform_device *pdev) static int __devexit da8xx_remove(struct platform_device *pdev)
{ {
struct da8xx_glue *glue = platform_get_drvdata(pdev); struct da8xx_glue *glue = platform_get_drvdata(pdev);
...@@ -576,7 +576,8 @@ static int __exit da8xx_remove(struct platform_device *pdev) ...@@ -576,7 +576,8 @@ static int __exit da8xx_remove(struct platform_device *pdev)
} }
static struct platform_driver da8xx_driver = { static struct platform_driver da8xx_driver = {
.remove = __exit_p(da8xx_remove), .probe = da8xx_probe,
.remove = __devexit_p(da8xx_remove),
.driver = { .driver = {
.name = "musb-da8xx", .name = "musb-da8xx",
}, },
...@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2");
static int __init da8xx_init(void) static int __init da8xx_init(void)
{ {
return platform_driver_probe(&da8xx_driver, da8xx_probe); return platform_driver_register(&da8xx_driver);
} }
subsys_initcall(da8xx_init); module_init(da8xx_init);
static void __exit da8xx_exit(void) static void __exit da8xx_exit(void)
{ {
......
...@@ -514,7 +514,7 @@ static const struct musb_platform_ops davinci_ops = { ...@@ -514,7 +514,7 @@ static const struct musb_platform_ops davinci_ops = {
static u64 davinci_dmamask = DMA_BIT_MASK(32); static u64 davinci_dmamask = DMA_BIT_MASK(32);
static int __init davinci_probe(struct platform_device *pdev) static int __devinit davinci_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -597,7 +597,7 @@ static int __init davinci_probe(struct platform_device *pdev) ...@@ -597,7 +597,7 @@ static int __init davinci_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit davinci_remove(struct platform_device *pdev) static int __devexit davinci_remove(struct platform_device *pdev)
{ {
struct davinci_glue *glue = platform_get_drvdata(pdev); struct davinci_glue *glue = platform_get_drvdata(pdev);
...@@ -611,7 +611,8 @@ static int __exit davinci_remove(struct platform_device *pdev) ...@@ -611,7 +611,8 @@ static int __exit davinci_remove(struct platform_device *pdev)
} }
static struct platform_driver davinci_driver = { static struct platform_driver davinci_driver = {
.remove = __exit_p(davinci_remove), .probe = davinci_probe,
.remove = __devexit_p(davinci_remove),
.driver = { .driver = {
.name = "musb-davinci", .name = "musb-davinci",
}, },
...@@ -623,9 +624,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -623,9 +624,9 @@ MODULE_LICENSE("GPL v2");
static int __init davinci_init(void) static int __init davinci_init(void)
{ {
return platform_driver_probe(&davinci_driver, davinci_probe); return platform_driver_register(&davinci_driver);
} }
subsys_initcall(davinci_init); module_init(davinci_init);
static void __exit davinci_exit(void) static void __exit davinci_exit(void)
{ {
......
...@@ -1014,12 +1014,12 @@ static void musb_shutdown(struct platform_device *pdev) ...@@ -1014,12 +1014,12 @@ static void musb_shutdown(struct platform_device *pdev)
|| defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \ || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \
|| defined(CONFIG_USB_MUSB_AM35X) \ || defined(CONFIG_USB_MUSB_AM35X) \
|| defined(CONFIG_USB_MUSB_AM35X_MODULE) || defined(CONFIG_USB_MUSB_AM35X_MODULE)
static ushort __initdata fifo_mode = 4; static ushort __devinitdata fifo_mode = 4;
#elif defined(CONFIG_USB_MUSB_UX500) \ #elif defined(CONFIG_USB_MUSB_UX500) \
|| defined(CONFIG_USB_MUSB_UX500_MODULE) || defined(CONFIG_USB_MUSB_UX500_MODULE)
static ushort __initdata fifo_mode = 5; static ushort __devinitdata fifo_mode = 5;
#else #else
static ushort __initdata fifo_mode = 2; static ushort __devinitdata fifo_mode = 2;
#endif #endif
/* "modprobe ... fifo_mode=1" etc */ /* "modprobe ... fifo_mode=1" etc */
...@@ -1032,7 +1032,7 @@ MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration"); ...@@ -1032,7 +1032,7 @@ MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration");
*/ */
/* mode 0 - fits in 2KB */ /* mode 0 - fits in 2KB */
static struct musb_fifo_cfg __initdata mode_0_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_0_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, }, { .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, },
...@@ -1041,7 +1041,7 @@ static struct musb_fifo_cfg __initdata mode_0_cfg[] = { ...@@ -1041,7 +1041,7 @@ static struct musb_fifo_cfg __initdata mode_0_cfg[] = {
}; };
/* mode 1 - fits in 4KB */ /* mode 1 - fits in 4KB */
static struct musb_fifo_cfg __initdata mode_1_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_1_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, }, { .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, },
...@@ -1050,7 +1050,7 @@ static struct musb_fifo_cfg __initdata mode_1_cfg[] = { ...@@ -1050,7 +1050,7 @@ static struct musb_fifo_cfg __initdata mode_1_cfg[] = {
}; };
/* mode 2 - fits in 4KB */ /* mode 2 - fits in 4KB */
static struct musb_fifo_cfg __initdata mode_2_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_2_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
...@@ -1060,7 +1060,7 @@ static struct musb_fifo_cfg __initdata mode_2_cfg[] = { ...@@ -1060,7 +1060,7 @@ static struct musb_fifo_cfg __initdata mode_2_cfg[] = {
}; };
/* mode 3 - fits in 4KB */ /* mode 3 - fits in 4KB */
static struct musb_fifo_cfg __initdata mode_3_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_3_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
...@@ -1070,7 +1070,7 @@ static struct musb_fifo_cfg __initdata mode_3_cfg[] = { ...@@ -1070,7 +1070,7 @@ static struct musb_fifo_cfg __initdata mode_3_cfg[] = {
}; };
/* mode 4 - fits in 16KB */ /* mode 4 - fits in 16KB */
static struct musb_fifo_cfg __initdata mode_4_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_4_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
...@@ -1101,7 +1101,7 @@ static struct musb_fifo_cfg __initdata mode_4_cfg[] = { ...@@ -1101,7 +1101,7 @@ static struct musb_fifo_cfg __initdata mode_4_cfg[] = {
}; };
/* mode 5 - fits in 8KB */ /* mode 5 - fits in 8KB */
static struct musb_fifo_cfg __initdata mode_5_cfg[] = { static struct musb_fifo_cfg __devinitdata mode_5_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
...@@ -1137,7 +1137,7 @@ static struct musb_fifo_cfg __initdata mode_5_cfg[] = { ...@@ -1137,7 +1137,7 @@ static struct musb_fifo_cfg __initdata mode_5_cfg[] = {
* *
* returns negative errno or offset for next fifo. * returns negative errno or offset for next fifo.
*/ */
static int __init static int __devinit
fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
const struct musb_fifo_cfg *cfg, u16 offset) const struct musb_fifo_cfg *cfg, u16 offset)
{ {
...@@ -1208,11 +1208,11 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, ...@@ -1208,11 +1208,11 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0)); return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0));
} }
static struct musb_fifo_cfg __initdata ep0_cfg = { static struct musb_fifo_cfg __devinitdata ep0_cfg = {
.style = FIFO_RXTX, .maxpacket = 64, .style = FIFO_RXTX, .maxpacket = 64,
}; };
static int __init ep_config_from_table(struct musb *musb) static int __devinit ep_config_from_table(struct musb *musb)
{ {
const struct musb_fifo_cfg *cfg; const struct musb_fifo_cfg *cfg;
unsigned i, n; unsigned i, n;
...@@ -1303,7 +1303,7 @@ static int __init ep_config_from_table(struct musb *musb) ...@@ -1303,7 +1303,7 @@ static int __init ep_config_from_table(struct musb *musb)
* ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false
* @param musb the controller * @param musb the controller
*/ */
static int __init ep_config_from_hw(struct musb *musb) static int __devinit ep_config_from_hw(struct musb *musb)
{ {
u8 epnum = 0; u8 epnum = 0;
struct musb_hw_ep *hw_ep; struct musb_hw_ep *hw_ep;
...@@ -1350,7 +1350,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, }; ...@@ -1350,7 +1350,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
/* Initialize MUSB (M)HDRC part of the USB hardware subsystem; /* Initialize MUSB (M)HDRC part of the USB hardware subsystem;
* configure endpoints, or take their config from silicon * configure endpoints, or take their config from silicon
*/ */
static int __init musb_core_init(u16 musb_type, struct musb *musb) static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
{ {
u8 reg; u8 reg;
char *type; char *type;
...@@ -1586,7 +1586,7 @@ irqreturn_t musb_interrupt(struct musb *musb) ...@@ -1586,7 +1586,7 @@ irqreturn_t musb_interrupt(struct musb *musb)
EXPORT_SYMBOL_GPL(musb_interrupt); EXPORT_SYMBOL_GPL(musb_interrupt);
#ifndef CONFIG_MUSB_PIO_ONLY #ifndef CONFIG_MUSB_PIO_ONLY
static bool __initdata use_dma = 1; static bool __devinitdata use_dma = 1;
/* "modprobe ... use_dma=0" etc */ /* "modprobe ... use_dma=0" etc */
module_param(use_dma, bool, 0); module_param(use_dma, bool, 0);
...@@ -1774,7 +1774,7 @@ static void musb_irq_work(struct work_struct *data) ...@@ -1774,7 +1774,7 @@ static void musb_irq_work(struct work_struct *data)
* Init support * Init support
*/ */
static struct musb *__init static struct musb *__devinit
allocate_instance(struct device *dev, allocate_instance(struct device *dev,
struct musb_hdrc_config *config, void __iomem *mbase) struct musb_hdrc_config *config, void __iomem *mbase)
{ {
...@@ -1852,7 +1852,7 @@ static void musb_free(struct musb *musb) ...@@ -1852,7 +1852,7 @@ static void musb_free(struct musb *musb)
* @mregs: virtual address of controller registers, * @mregs: virtual address of controller registers,
* not yet corrected for platform-specific offsets * not yet corrected for platform-specific offsets
*/ */
static int __init static int __devinit
musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
{ {
int status; int status;
...@@ -2072,7 +2072,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -2072,7 +2072,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
static u64 *orig_dma_mask; static u64 *orig_dma_mask;
#endif #endif
static int __init musb_probe(struct platform_device *pdev) static int __devinit musb_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int irq = platform_get_irq_byname(pdev, "mc"); int irq = platform_get_irq_byname(pdev, "mc");
...@@ -2101,7 +2101,7 @@ static int __init musb_probe(struct platform_device *pdev) ...@@ -2101,7 +2101,7 @@ static int __init musb_probe(struct platform_device *pdev)
return status; return status;
} }
static int __exit musb_remove(struct platform_device *pdev) static int __devexit musb_remove(struct platform_device *pdev)
{ {
struct musb *musb = dev_to_musb(&pdev->dev); struct musb *musb = dev_to_musb(&pdev->dev);
void __iomem *ctrl_base = musb->ctrl_base; void __iomem *ctrl_base = musb->ctrl_base;
...@@ -2361,7 +2361,8 @@ static struct platform_driver musb_driver = { ...@@ -2361,7 +2361,8 @@ static struct platform_driver musb_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = MUSB_DEV_PM_OPS, .pm = MUSB_DEV_PM_OPS,
}, },
.remove = __exit_p(musb_remove), .probe = musb_probe,
.remove = __devexit_p(musb_remove),
.shutdown = musb_shutdown, .shutdown = musb_shutdown,
}; };
...@@ -2377,13 +2378,9 @@ static int __init musb_init(void) ...@@ -2377,13 +2378,9 @@ static int __init musb_init(void)
", " ", "
"otg (peripheral+host)", "otg (peripheral+host)",
musb_driver_name); musb_driver_name);
return platform_driver_probe(&musb_driver, musb_probe); return platform_driver_register(&musb_driver);
} }
module_init(musb_init);
/* make us init after usbcore and i2c (transceivers, regulators, etc)
* and before usb gadget and host-side drivers start to register
*/
fs_initcall(musb_init);
static void __exit musb_cleanup(void) static void __exit musb_cleanup(void)
{ {
......
...@@ -235,7 +235,7 @@ static const struct file_operations musb_test_mode_fops = { ...@@ -235,7 +235,7 @@ static const struct file_operations musb_test_mode_fops = {
.release = single_release, .release = single_release,
}; };
int __init musb_init_debugfs(struct musb *musb) int __devinit musb_init_debugfs(struct musb *musb)
{ {
struct dentry *root; struct dentry *root;
struct dentry *file; struct dentry *file;
......
...@@ -1762,7 +1762,7 @@ static void musb_gadget_release(struct device *dev) ...@@ -1762,7 +1762,7 @@ static void musb_gadget_release(struct device *dev)
} }
static void __init static void __devinit
init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
{ {
struct musb_hw_ep *hw_ep = musb->endpoints + epnum; struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
...@@ -1799,7 +1799,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) ...@@ -1799,7 +1799,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
* Initialize the endpoints exposed to peripheral drivers, with backlinks * Initialize the endpoints exposed to peripheral drivers, with backlinks
* to the rest of the driver state. * to the rest of the driver state.
*/ */
static inline void __init musb_g_init_endpoints(struct musb *musb) static inline void __devinit musb_g_init_endpoints(struct musb *musb)
{ {
u8 epnum; u8 epnum;
struct musb_hw_ep *hw_ep; struct musb_hw_ep *hw_ep;
...@@ -1832,7 +1832,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) ...@@ -1832,7 +1832,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb)
/* called once during driver setup to initialize and link into /* called once during driver setup to initialize and link into
* the driver model; memory is zeroed. * the driver model; memory is zeroed.
*/ */
int __init musb_gadget_setup(struct musb *musb) int __devinit musb_gadget_setup(struct musb *musb)
{ {
int status; int status;
......
...@@ -408,7 +408,7 @@ static const struct musb_platform_ops omap2430_ops = { ...@@ -408,7 +408,7 @@ static const struct musb_platform_ops omap2430_ops = {
static u64 omap2430_dmamask = DMA_BIT_MASK(32); static u64 omap2430_dmamask = DMA_BIT_MASK(32);
static int __init omap2430_probe(struct platform_device *pdev) static int __devinit omap2430_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -471,7 +471,7 @@ static int __init omap2430_probe(struct platform_device *pdev) ...@@ -471,7 +471,7 @@ static int __init omap2430_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit omap2430_remove(struct platform_device *pdev) static int __devexit omap2430_remove(struct platform_device *pdev)
{ {
struct omap2430_glue *glue = platform_get_drvdata(pdev); struct omap2430_glue *glue = platform_get_drvdata(pdev);
...@@ -524,7 +524,8 @@ static struct dev_pm_ops omap2430_pm_ops = { ...@@ -524,7 +524,8 @@ static struct dev_pm_ops omap2430_pm_ops = {
#endif #endif
static struct platform_driver omap2430_driver = { static struct platform_driver omap2430_driver = {
.remove = __exit_p(omap2430_remove), .probe = omap2430_probe,
.remove = __devexit_p(omap2430_remove),
.driver = { .driver = {
.name = "musb-omap2430", .name = "musb-omap2430",
.pm = DEV_PM_OPS, .pm = DEV_PM_OPS,
...@@ -537,9 +538,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -537,9 +538,9 @@ MODULE_LICENSE("GPL v2");
static int __init omap2430_init(void) static int __init omap2430_init(void)
{ {
return platform_driver_probe(&omap2430_driver, omap2430_probe); return platform_driver_register(&omap2430_driver);
} }
subsys_initcall(omap2430_init); module_init(omap2430_init);
static void __exit omap2430_exit(void) static void __exit omap2430_exit(void)
{ {
......
...@@ -1165,7 +1165,7 @@ static const struct musb_platform_ops tusb_ops = { ...@@ -1165,7 +1165,7 @@ static const struct musb_platform_ops tusb_ops = {
static u64 tusb_dmamask = DMA_BIT_MASK(32); static u64 tusb_dmamask = DMA_BIT_MASK(32);
static int __init tusb_probe(struct platform_device *pdev) static int __devinit tusb_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -1227,7 +1227,7 @@ static int __init tusb_probe(struct platform_device *pdev) ...@@ -1227,7 +1227,7 @@ static int __init tusb_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit tusb_remove(struct platform_device *pdev) static int __devexit tusb_remove(struct platform_device *pdev)
{ {
struct tusb6010_glue *glue = platform_get_drvdata(pdev); struct tusb6010_glue *glue = platform_get_drvdata(pdev);
...@@ -1239,7 +1239,8 @@ static int __exit tusb_remove(struct platform_device *pdev) ...@@ -1239,7 +1239,8 @@ static int __exit tusb_remove(struct platform_device *pdev)
} }
static struct platform_driver tusb_driver = { static struct platform_driver tusb_driver = {
.remove = __exit_p(tusb_remove), .probe = tusb_probe,
.remove = __devexit_p(tusb_remove),
.driver = { .driver = {
.name = "musb-tusb", .name = "musb-tusb",
}, },
...@@ -1251,9 +1252,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -1251,9 +1252,9 @@ MODULE_LICENSE("GPL v2");
static int __init tusb_init(void) static int __init tusb_init(void)
{ {
return platform_driver_probe(&tusb_driver, tusb_probe); return platform_driver_register(&tusb_driver);
} }
subsys_initcall(tusb_init); module_init(tusb_init);
static void __exit tusb_exit(void) static void __exit tusb_exit(void)
{ {
......
...@@ -58,7 +58,7 @@ static const struct musb_platform_ops ux500_ops = { ...@@ -58,7 +58,7 @@ static const struct musb_platform_ops ux500_ops = {
.exit = ux500_musb_exit, .exit = ux500_musb_exit,
}; };
static int __init ux500_probe(struct platform_device *pdev) static int __devinit ux500_probe(struct platform_device *pdev)
{ {
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb; struct platform_device *musb;
...@@ -141,7 +141,7 @@ static int __init ux500_probe(struct platform_device *pdev) ...@@ -141,7 +141,7 @@ static int __init ux500_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit ux500_remove(struct platform_device *pdev) static int __devexit ux500_remove(struct platform_device *pdev)
{ {
struct ux500_glue *glue = platform_get_drvdata(pdev); struct ux500_glue *glue = platform_get_drvdata(pdev);
...@@ -194,7 +194,8 @@ static const struct dev_pm_ops ux500_pm_ops = { ...@@ -194,7 +194,8 @@ static const struct dev_pm_ops ux500_pm_ops = {
#endif #endif
static struct platform_driver ux500_driver = { static struct platform_driver ux500_driver = {
.remove = __exit_p(ux500_remove), .probe = ux500_probe,
.remove = __devexit_p(ux500_remove),
.driver = { .driver = {
.name = "musb-ux500", .name = "musb-ux500",
.pm = DEV_PM_OPS, .pm = DEV_PM_OPS,
...@@ -207,9 +208,9 @@ MODULE_LICENSE("GPL v2"); ...@@ -207,9 +208,9 @@ MODULE_LICENSE("GPL v2");
static int __init ux500_init(void) static int __init ux500_init(void)
{ {
return platform_driver_probe(&ux500_driver, ux500_probe); return platform_driver_register(&ux500_driver);
} }
subsys_initcall(ux500_init); module_init(ux500_init);
static void __exit ux500_exit(void) static void __exit ux500_exit(void)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册