diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/dpi.c')
-rw-r--r-- | drivers/video/fbdev/omap2/dss/dpi.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c index f83e7b030249..fb45b6432968 100644 --- a/drivers/video/fbdev/omap2/dss/dpi.c +++ b/drivers/video/fbdev/omap2/dss/dpi.c @@ -32,6 +32,7 @@ #include <linux/string.h> #include <linux/of.h> #include <linux/clk.h> +#include <linux/component.h> #include <video/omapdss.h> @@ -731,7 +732,7 @@ static void dpi_init_output(struct platform_device *pdev) omapdss_register_output(out); } -static void __exit dpi_uninit_output(struct platform_device *pdev) +static void dpi_uninit_output(struct platform_device *pdev) { struct dpi_data *dpi = dpi_get_data_from_pdev(pdev); struct omap_dss_device *out = &dpi->output; @@ -775,7 +776,7 @@ static void dpi_init_output_port(struct platform_device *pdev, omapdss_register_output(out); } -static void __exit dpi_uninit_output_port(struct device_node *port) +static void dpi_uninit_output_port(struct device_node *port) { struct dpi_data *dpi = port->data; struct omap_dss_device *out = &dpi->output; @@ -783,8 +784,9 @@ static void __exit dpi_uninit_output_port(struct device_node *port) omapdss_unregister_output(out); } -static int omap_dpi_probe(struct platform_device *pdev) +static int dpi_bind(struct device *dev, struct device *master, void *data) { + struct platform_device *pdev = to_platform_device(dev); struct dpi_data *dpi; dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL); @@ -802,16 +804,32 @@ static int omap_dpi_probe(struct platform_device *pdev) return 0; } -static int __exit omap_dpi_remove(struct platform_device *pdev) +static void dpi_unbind(struct device *dev, struct device *master, void *data) { + struct platform_device *pdev = to_platform_device(dev); + dpi_uninit_output(pdev); +} + +static const struct component_ops dpi_component_ops = { + .bind = dpi_bind, + .unbind = dpi_unbind, +}; +static int dpi_probe(struct platform_device *pdev) +{ + return component_add(&pdev->dev, &dpi_component_ops); +} + +static int dpi_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dpi_component_ops); return 0; } static struct platform_driver omap_dpi_driver = { - .probe = omap_dpi_probe, - .remove = __exit_p(omap_dpi_remove), + .probe = dpi_probe, + .remove = dpi_remove, .driver = { .name = "omapdss_dpi", .suppress_bind_attrs = true, @@ -823,12 +841,12 @@ int __init dpi_init_platform_driver(void) return platform_driver_register(&omap_dpi_driver); } -void __exit dpi_uninit_platform_driver(void) +void dpi_uninit_platform_driver(void) { platform_driver_unregister(&omap_dpi_driver); } -int __init dpi_init_port(struct platform_device *pdev, struct device_node *port) +int dpi_init_port(struct platform_device *pdev, struct device_node *port) { struct dpi_data *dpi; struct device_node *ep; @@ -870,7 +888,7 @@ err_datalines: return r; } -void __exit dpi_uninit_port(struct device_node *port) +void dpi_uninit_port(struct device_node *port) { struct dpi_data *dpi = port->data; |