diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/rfbi.c')
-rw-r--r-- | drivers/video/fbdev/omap2/dss/rfbi.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/video/fbdev/omap2/dss/rfbi.c index 065effca9236..1525a494d057 100644 --- a/drivers/video/fbdev/omap2/dss/rfbi.c +++ b/drivers/video/fbdev/omap2/dss/rfbi.c @@ -36,6 +36,7 @@ #include <linux/semaphore.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/component.h> #include <video/omapdss.h> #include "dss.h" @@ -938,7 +939,7 @@ static void rfbi_init_output(struct platform_device *pdev) omapdss_register_output(out); } -static void __exit rfbi_uninit_output(struct platform_device *pdev) +static void rfbi_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &rfbi.output; @@ -946,8 +947,9 @@ static void __exit rfbi_uninit_output(struct platform_device *pdev) } /* RFBI HW IP initialisation */ -static int omap_rfbihw_probe(struct platform_device *pdev) +static int rfbi_bind(struct device *dev, struct device *master, void *data) { + struct platform_device *pdev = to_platform_device(dev); u32 rev; struct resource *rfbi_mem; struct clk *clk; @@ -1005,8 +1007,10 @@ err_runtime_get: return r; } -static int __exit omap_rfbihw_remove(struct platform_device *pdev) +static void rfbi_unbind(struct device *dev, struct device *master, void *data) { + struct platform_device *pdev = to_platform_device(dev); + rfbi_uninit_output(pdev); pm_runtime_disable(&pdev->dev); @@ -1014,6 +1018,22 @@ static int __exit omap_rfbihw_remove(struct platform_device *pdev) return 0; } +static const struct component_ops rfbi_component_ops = { + .bind = rfbi_bind, + .unbind = rfbi_unbind, +}; + +static int rfbi_probe(struct platform_device *pdev) +{ + return component_add(&pdev->dev, &rfbi_component_ops); +} + +static int rfbi_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &rfbi_component_ops); + return 0; +} + static int rfbi_runtime_suspend(struct device *dev) { dispc_runtime_put(); @@ -1038,8 +1058,8 @@ static const struct dev_pm_ops rfbi_pm_ops = { }; static struct platform_driver omap_rfbihw_driver = { - .probe = omap_rfbihw_probe, - .remove = __exit_p(omap_rfbihw_remove), + .probe = rfbi_probe, + .remove = rfbi_remove, .driver = { .name = "omapdss_rfbi", .pm = &rfbi_pm_ops, @@ -1052,7 +1072,7 @@ int __init rfbi_init_platform_driver(void) return platform_driver_register(&omap_rfbihw_driver); } -void __exit rfbi_uninit_platform_driver(void) +void rfbi_uninit_platform_driver(void) { platform_driver_unregister(&omap_rfbihw_driver); } |