[media] convert drivers/media/* to use module_platform_driver()

This patch converts the drivers in drivers/media/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: "Richard Röjfors" <richard.rojfors@pelagicore.com>
Cc: "Matti J. Aaltonen" <matti.j.aaltonen@nokia.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Muralidharan Karicheri <m-karicheri2@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Daniel Drake <dsd@laptop.org>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Axel Lin 2012-01-10 03:21:49 -03:00 committed by Mauro Carvalho Chehab
parent aa5fb974cf
commit 1d6629b156
25 changed files with 26 additions and 406 deletions

View File

@ -355,17 +355,4 @@ static struct platform_driver radio_si4713_pdriver = {
.remove = __exit_p(radio_si4713_pdriver_remove),
};
/* Module Interface */
static int __init radio_si4713_module_init(void)
{
return platform_driver_register(&radio_si4713_pdriver);
}
static void __exit radio_si4713_module_exit(void)
{
platform_driver_unregister(&radio_si4713_pdriver);
}
module_init(radio_si4713_module_init);
module_exit(radio_si4713_module_exit);
module_platform_driver(radio_si4713_pdriver);

View File

@ -226,20 +226,7 @@ static struct platform_driver timbradio_platform_driver = {
.remove = timbradio_remove,
};
/*--------------------------------------------------------------------------*/
static int __init timbradio_init(void)
{
return platform_driver_register(&timbradio_platform_driver);
}
static void __exit timbradio_exit(void)
{
platform_driver_unregister(&timbradio_platform_driver);
}
module_init(timbradio_init);
module_exit(timbradio_exit);
module_platform_driver(timbradio_platform_driver);
MODULE_DESCRIPTION("Timberdale Radio driver");
MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");

View File

@ -2148,8 +2148,6 @@ pdata_err:
return r;
}
MODULE_ALIAS("platform:wl1273_fm_radio");
static struct platform_driver wl1273_fm_radio_driver = {
.probe = wl1273_fm_radio_probe,
.remove = __devexit_p(wl1273_fm_radio_remove),
@ -2159,20 +2157,9 @@ static struct platform_driver wl1273_fm_radio_driver = {
},
};
static int __init wl1273_fm_module_init(void)
{
pr_info("%s\n", __func__);
return platform_driver_register(&wl1273_fm_radio_driver);
}
module_init(wl1273_fm_module_init);
static void __exit wl1273_fm_module_exit(void)
{
platform_driver_unregister(&wl1273_fm_radio_driver);
pr_info(DRIVER_DESC ", Exiting.\n");
}
module_exit(wl1273_fm_module_exit);
module_platform_driver(wl1273_fm_radio_driver);
MODULE_AUTHOR("Matti Aaltonen <matti.j.aaltonen@nokia.com>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:wl1273_fm_radio");

View File

@ -1069,15 +1069,4 @@ static struct platform_driver dm355_ccdc_driver = {
.probe = dm355_ccdc_probe,
};
static int __init dm355_ccdc_init(void)
{
return platform_driver_register(&dm355_ccdc_driver);
}
static void __exit dm355_ccdc_exit(void)
{
platform_driver_unregister(&dm355_ccdc_driver);
}
module_init(dm355_ccdc_init);
module_exit(dm355_ccdc_exit);
module_platform_driver(dm355_ccdc_driver);

View File

@ -1078,15 +1078,4 @@ static struct platform_driver dm644x_ccdc_driver = {
.probe = dm644x_ccdc_probe,
};
static int __init dm644x_ccdc_init(void)
{
return platform_driver_register(&dm644x_ccdc_driver);
}
static void __exit dm644x_ccdc_exit(void)
{
platform_driver_unregister(&dm644x_ccdc_driver);
}
module_init(dm644x_ccdc_init);
module_exit(dm644x_ccdc_exit);
module_platform_driver(dm644x_ccdc_driver);

View File

@ -1156,17 +1156,6 @@ static struct platform_driver isif_driver = {
.probe = isif_probe,
};
static int __init isif_init(void)
{
return platform_driver_register(&isif_driver);
}
static void isif_exit(void)
{
platform_driver_unregister(&isif_driver);
}
module_init(isif_init);
module_exit(isif_exit);
module_platform_driver(isif_driver);
MODULE_LICENSE("GPL");

View File

@ -883,26 +883,4 @@ static struct platform_driver vpbe_driver = {
.remove = vpbe_remove,
};
/**
* vpbe_init: initialize the vpbe driver
*
* This function registers device and driver to the kernel
*/
static __init int vpbe_init(void)
{
return platform_driver_register(&vpbe_driver);
}
/**
* vpbe_cleanup : cleanup function for vpbe driver
*
* This will un-registers the device and driver to the kernel
*/
static void vpbe_cleanup(void)
{
platform_driver_unregister(&vpbe_driver);
}
/* Function for module initialization and cleanup */
module_init(vpbe_init);
module_exit(vpbe_cleanup);
module_platform_driver(vpbe_driver);

View File

@ -1817,43 +1817,7 @@ static struct platform_driver vpbe_display_driver = {
.remove = __devexit_p(vpbe_display_remove),
};
/*
* vpbe_display_init()
* This function registers device and driver to the kernel, requests irq
* handler and allocates memory for layer objects
*/
static __devinit int vpbe_display_init(void)
{
int err;
printk(KERN_DEBUG "vpbe_display_init\n");
/* Register driver to the kernel */
err = platform_driver_register(&vpbe_display_driver);
if (0 != err)
return err;
printk(KERN_DEBUG "vpbe_display_init:"
"VPBE V4L2 Display Driver V1.0 loaded\n");
return 0;
}
/*
* vpbe_display_cleanup()
* This function un-registers device and driver to the kernel, frees requested
* irq handler and de-allocates memory allocated for layer objects.
*/
static void vpbe_display_cleanup(void)
{
printk(KERN_DEBUG "vpbe_display_cleanup\n");
/* platform driver unregister */
platform_driver_unregister(&vpbe_display_driver);
}
/* Function for module initialization and cleanup */
module_init(vpbe_display_init);
module_exit(vpbe_display_cleanup);
module_platform_driver(vpbe_display_driver);
MODULE_DESCRIPTION("TI DM644x/DM355/DM365 VPBE Display controller");
MODULE_LICENSE("GPL");

View File

@ -1599,23 +1599,7 @@ static struct platform_driver osd_driver = {
},
};
static int osd_init(void)
{
if (platform_driver_register(&osd_driver)) {
printk(KERN_ERR "Unable to register davinci osd driver\n");
return -ENODEV;
}
return 0;
}
static void osd_exit(void)
{
platform_driver_unregister(&osd_driver);
}
module_init(osd_init);
module_exit(osd_exit);
module_platform_driver(osd_driver);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DaVinci OSD Manager Driver");

View File

@ -700,23 +700,7 @@ static struct platform_driver venc_driver = {
},
};
static int venc_init(void)
{
if (platform_driver_register(&venc_driver)) {
printk(KERN_ERR "Unable to register venc driver\n");
return -ENODEV;
}
return 0;
}
static void venc_exit(void)
{
platform_driver_unregister(&venc_driver);
return;
}
module_init(venc_init);
module_exit(venc_exit);
module_platform_driver(venc_driver);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VPBE VENC Driver");

View File

@ -2076,20 +2076,4 @@ static struct platform_driver vpfe_driver = {
.remove = __devexit_p(vpfe_remove),
};
static __init int vpfe_init(void)
{
printk(KERN_NOTICE "vpfe_init\n");
/* Register driver to the kernel */
return platform_driver_register(&vpfe_driver);
}
/*
* vpfe_cleanup : This function un-registers device driver
*/
static void vpfe_cleanup(void)
{
platform_driver_unregister(&vpfe_driver);
}
module_init(vpfe_init);
module_exit(vpfe_cleanup);
module_platform_driver(vpfe_driver);

View File

@ -1661,18 +1661,7 @@ static struct platform_driver viu_of_platform_driver = {
},
};
static int __init viu_init(void)
{
return platform_driver_register(&viu_of_platform_driver);
}
static void __exit viu_exit(void)
{
platform_driver_unregister(&viu_of_platform_driver);
}
module_init(viu_init);
module_exit(viu_exit);
module_platform_driver(viu_of_platform_driver);
MODULE_DESCRIPTION("Freescale Video-In(VIU)");
MODULE_AUTHOR("Hongjun Chen");

View File

@ -1286,19 +1286,7 @@ static struct platform_driver mx3_camera_driver = {
.remove = __devexit_p(mx3_camera_remove),
};
static int __init mx3_camera_init(void)
{
return platform_driver_register(&mx3_camera_driver);
}
static void __exit mx3_camera_exit(void)
{
platform_driver_unregister(&mx3_camera_driver);
}
module_init(mx3_camera_init);
module_exit(mx3_camera_exit);
module_platform_driver(mx3_camera_driver);
MODULE_DESCRIPTION("i.MX3x SoC Camera Host driver");
MODULE_AUTHOR("Guennadi Liakhovetski <lg@denx.de>");

View File

@ -1713,17 +1713,7 @@ static struct platform_driver omap1_cam_driver = {
.remove = __exit_p(omap1_cam_remove),
};
static int __init omap1_cam_init(void)
{
return platform_driver_register(&omap1_cam_driver);
}
module_init(omap1_cam_init);
static void __exit omap1_cam_exit(void)
{
platform_driver_unregister(&omap1_cam_driver);
}
module_exit(omap1_cam_exit);
module_platform_driver(omap1_cam_driver);
module_param(sg_mode, bool, 0644);
MODULE_PARM_DESC(sg_mode, "videobuf mode, 0: dma-contig (default), 1: dma-sg");

View File

@ -1868,21 +1868,7 @@ static struct platform_driver omap24xxcam_driver = {
},
};
/*
*
* Module initialisation and deinitialisation
*
*/
static int __init omap24xxcam_init(void)
{
return platform_driver_register(&omap24xxcam_driver);
}
static void __exit omap24xxcam_cleanup(void)
{
platform_driver_unregister(&omap24xxcam_driver);
}
module_platform_driver(omap24xxcam_driver);
MODULE_AUTHOR("Sakari Ailus <sakari.ailus@nokia.com>");
MODULE_DESCRIPTION("OMAP24xx Video for Linux camera driver");
@ -1894,6 +1880,3 @@ MODULE_PARM_DESC(video_nr,
module_param(capture_mem, int, 0);
MODULE_PARM_DESC(capture_mem, "Maximum amount of memory for capture "
"buffers (default 4800kiB)");
module_init(omap24xxcam_init);
module_exit(omap24xxcam_cleanup);

View File

@ -2247,24 +2247,7 @@ static struct platform_driver omap3isp_driver = {
},
};
/*
* isp_init - ISP module initialization.
*/
static int __init isp_init(void)
{
return platform_driver_register(&omap3isp_driver);
}
/*
* isp_cleanup - ISP module cleanup.
*/
static void __exit isp_cleanup(void)
{
platform_driver_unregister(&omap3isp_driver);
}
module_init(isp_init);
module_exit(isp_cleanup);
module_platform_driver(omap3isp_driver);
MODULE_AUTHOR("Nokia Corporation");
MODULE_DESCRIPTION("TI OMAP3 ISP driver");

View File

@ -1852,19 +1852,7 @@ static struct platform_driver pxa_camera_driver = {
.remove = __devexit_p(pxa_camera_remove),
};
static int __init pxa_camera_init(void)
{
return platform_driver_register(&pxa_camera_driver);
}
static void __exit pxa_camera_exit(void)
{
platform_driver_unregister(&pxa_camera_driver);
}
module_init(pxa_camera_init);
module_exit(pxa_camera_exit);
module_platform_driver(pxa_camera_driver);
MODULE_DESCRIPTION("PXA27x SoC Camera Host driver");
MODULE_AUTHOR("Guennadi Liakhovetski <kernel@pengutronix.de>");

View File

@ -803,21 +803,7 @@ static struct platform_driver g2d_pdrv = {
},
};
static void __exit g2d_exit(void)
{
platform_driver_unregister(&g2d_pdrv);
};
static int __init g2d_init(void)
{
int ret = 0;
ret = platform_driver_register(&g2d_pdrv);
return ret;
};
module_init(g2d_init);
module_exit(g2d_exit);
module_platform_driver(g2d_pdrv);
MODULE_AUTHOR("Kamil Debski <k.debski@samsung.com>");
MODULE_DESCRIPTION("S5P G2D 2d graphics accelerator driver");

View File

@ -1245,27 +1245,7 @@ static struct platform_driver s5p_mfc_driver = {
},
};
static char banner[] __initdata =
"S5P MFC V4L2 Driver, (C) 2011 Samsung Electronics\n";
static int __init s5p_mfc_init(void)
{
int ret;
pr_info("%s", banner);
ret = platform_driver_register(&s5p_mfc_driver);
if (ret)
pr_err("Platform device registration failed.\n");
return ret;
}
static void __exit s5p_mfc_exit(void)
{
platform_driver_unregister(&s5p_mfc_driver);
}
module_init(s5p_mfc_init);
module_exit(s5p_mfc_exit);
module_platform_driver(s5p_mfc_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kamil Debski <k.debski@samsung.com>");

View File

@ -1016,28 +1016,4 @@ static struct platform_driver hdmi_driver __refdata = {
}
};
/* D R I V E R I N I T I A L I Z A T I O N */
static int __init hdmi_init(void)
{
int ret;
static const char banner[] __initdata = KERN_INFO \
"Samsung HDMI output driver, "
"(c) 2010-2011 Samsung Electronics Co., Ltd.\n";
printk(banner);
ret = platform_driver_register(&hdmi_driver);
if (ret)
printk(KERN_ERR "HDMI platform driver register failed\n");
return ret;
}
module_init(hdmi_init);
static void __exit hdmi_exit(void)
{
platform_driver_unregister(&hdmi_driver);
}
module_exit(hdmi_exit);
module_platform_driver(hdmi_driver);

View File

@ -457,24 +457,4 @@ static struct platform_driver sdo_driver __refdata = {
}
};
static int __init sdo_init(void)
{
int ret;
static const char banner[] __initdata = KERN_INFO \
"Samsung Standard Definition Output (SDO) driver, "
"(c) 2010-2011 Samsung Electronics Co., Ltd.\n";
printk(banner);
ret = platform_driver_register(&sdo_driver);
if (ret)
printk(KERN_ERR "SDO platform driver register failed\n");
return ret;
}
module_init(sdo_init);
static void __exit sdo_exit(void)
{
platform_driver_unregister(&sdo_driver);
}
module_exit(sdo_exit);
module_platform_driver(sdo_driver);

View File

@ -390,18 +390,7 @@ static struct platform_driver __refdata sh_csi2_pdrv = {
},
};
static int __init sh_csi2_init(void)
{
return platform_driver_register(&sh_csi2_pdrv);
}
static void __exit sh_csi2_exit(void)
{
platform_driver_unregister(&sh_csi2_pdrv);
}
module_init(sh_csi2_init);
module_exit(sh_csi2_exit);
module_platform_driver(sh_csi2_pdrv);
MODULE_DESCRIPTION("SH-Mobile MIPI CSI-2 driver");
MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");

View File

@ -189,18 +189,7 @@ static struct platform_driver soc_camera_platform_driver = {
.remove = soc_camera_platform_remove,
};
static int __init soc_camera_platform_module_init(void)
{
return platform_driver_register(&soc_camera_platform_driver);
}
static void __exit soc_camera_platform_module_exit(void)
{
platform_driver_unregister(&soc_camera_platform_driver);
}
module_init(soc_camera_platform_module_init);
module_exit(soc_camera_platform_module_exit);
module_platform_driver(soc_camera_platform_driver);
MODULE_DESCRIPTION("SoC Camera Platform driver");
MODULE_AUTHOR("Magnus Damm");

View File

@ -872,20 +872,7 @@ static struct platform_driver timblogiw_platform_driver = {
.remove = __devexit_p(timblogiw_remove),
};
/* Module functions */
static int __init timblogiw_init(void)
{
return platform_driver_register(&timblogiw_platform_driver);
}
static void __exit timblogiw_exit(void)
{
platform_driver_unregister(&timblogiw_platform_driver);
}
module_init(timblogiw_init);
module_exit(timblogiw_exit);
module_platform_driver(timblogiw_platform_driver);
MODULE_DESCRIPTION(TIMBLOGIWIN_NAME);
MODULE_AUTHOR("Pelagicore AB <info@pelagicore.com>");

View File

@ -1500,14 +1500,4 @@ static struct platform_driver viacam_driver = {
.remove = viacam_remove,
};
static int viacam_init(void)
{
return platform_driver_register(&viacam_driver);
}
module_init(viacam_init);
static void viacam_exit(void)
{
platform_driver_unregister(&viacam_driver);
}
module_exit(viacam_exit);
module_platform_driver(viacam_driver);