Commit dc6b77ba authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Helge Deller
Browse files

fbdev: omapfb: Convert to platform remove callback returning void



The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent db031426
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1799,7 +1799,7 @@ void omapfb_register_panel(struct lcd_panel *panel)
EXPORT_SYMBOL_GPL(omapfb_register_panel);

/* Called when the device is being detached from the driver */
static int omapfb_remove(struct platform_device *pdev)
static void omapfb_remove(struct platform_device *pdev)
{
	struct omapfb_device *fbdev = platform_get_drvdata(pdev);
	enum omapfb_state saved_state = fbdev->state;
@@ -1811,8 +1811,6 @@ static int omapfb_remove(struct platform_device *pdev)

	platform_device_unregister(&omapdss_device);
	fbdev->dssdev = NULL;

	return 0;
}

/* PM suspend */
@@ -1837,7 +1835,7 @@ static int omapfb_resume(struct platform_device *pdev)

static struct platform_driver omapfb_driver = {
	.probe		= omapfb_probe,
	.remove		= omapfb_remove,
	.remove_new	= omapfb_remove,
	.suspend	= omapfb_suspend,
	.resume		= omapfb_resume,
	.driver		= {
+2 −4
Original line number Diff line number Diff line
@@ -171,13 +171,11 @@ static int __init omap_dss_probe(struct platform_device *pdev)
	return 0;
}

static int omap_dss_remove(struct platform_device *pdev)
static void omap_dss_remove(struct platform_device *pdev)
{
	unregister_pm_notifier(&omap_dss_pm_notif_block);

	dss_uninitialize_debugfs();

	return 0;
}

static void omap_dss_shutdown(struct platform_device *pdev)
@@ -187,7 +185,7 @@ static void omap_dss_shutdown(struct platform_device *pdev)
}

static struct platform_driver omap_dss_driver = {
	.remove         = omap_dss_remove,
	.remove_new     = omap_dss_remove,
	.shutdown	= omap_dss_shutdown,
	.driver         = {
		.name   = "omapdss",
+2 −3
Original line number Diff line number Diff line
@@ -4017,10 +4017,9 @@ static int dispc_probe(struct platform_device *pdev)
	return component_add(&pdev->dev, &dispc_component_ops);
}

static int dispc_remove(struct platform_device *pdev)
static void dispc_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &dispc_component_ops);
	return 0;
}

static int dispc_runtime_suspend(struct device *dev)
@@ -4073,7 +4072,7 @@ static const struct of_device_id dispc_of_match[] = {

static struct platform_driver omap_dispchw_driver = {
	.probe		= dispc_probe,
	.remove         = dispc_remove,
	.remove_new     = dispc_remove,
	.driver         = {
		.name   = "omapdss_dispc",
		.pm	= &dispc_pm_ops,
+2 −3
Original line number Diff line number Diff line
@@ -810,15 +810,14 @@ static int dpi_probe(struct platform_device *pdev)
	return component_add(&pdev->dev, &dpi_component_ops);
}

static int dpi_remove(struct platform_device *pdev)
static void dpi_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &dpi_component_ops);
	return 0;
}

static struct platform_driver omap_dpi_driver = {
	.probe		= dpi_probe,
	.remove		= dpi_remove,
	.remove_new	= dpi_remove,
	.driver         = {
		.name   = "omapdss_dpi",
		.suppress_bind_attrs = true,
+2 −3
Original line number Diff line number Diff line
@@ -5495,10 +5495,9 @@ static int dsi_probe(struct platform_device *pdev)
	return component_add(&pdev->dev, &dsi_component_ops);
}

static int dsi_remove(struct platform_device *pdev)
static void dsi_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &dsi_component_ops);
	return 0;
}

static int dsi_runtime_suspend(struct device *dev)
@@ -5565,7 +5564,7 @@ static const struct of_device_id dsi_of_match[] = {

static struct platform_driver omap_dsihw_driver = {
	.probe		= dsi_probe,
	.remove		= dsi_remove,
	.remove_new	= dsi_remove,
	.driver         = {
		.name   = "omapdss_dsi",
		.pm	= &dsi_pm_ops,
Loading