From 8768a52f8f53e6f54bce77faade1007d4142fa7c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 6 Sep 2012 13:57:39 +0300 Subject: [PATCH] OMAPDSS: omap_dss_register_device() doesn't take display index We used to have all the displays of the board in one list, and we made a "displayX" directory in the sysfs, where X was the index of the display in the list. This doesn't work anymore with device tree, as there's no single list to get the number from, and it doesn't work very well even with non-DT as we need to do some tricks to get the index nowadays. This patch changes omap_dss_register_device() so that it doesn't take disp_num as a parameter anymore, but uses a private increasing counter for the display number. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/core.c | 9 +++++---- drivers/video/omap2/dss/dpi.c | 2 +- drivers/video/omap2/dss/dsi.c | 2 +- drivers/video/omap2/dss/dss.h | 2 +- drivers/video/omap2/dss/hdmi.c | 2 +- drivers/video/omap2/dss/rfbi.c | 2 +- drivers/video/omap2/dss/sdi.c | 2 +- drivers/video/omap2/dss/venc.c | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 58bd9c27369..20c8bc8291b 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -450,16 +450,17 @@ static void omap_dss_dev_release(struct device *dev) reset_device(dev, 0); } +static int disp_num_counter; + int omap_dss_register_device(struct omap_dss_device *dssdev, - struct device *parent, int disp_num) + struct device *parent) { - WARN_ON(!dssdev->driver_name); - reset_device(&dssdev->dev, 1); + dssdev->dev.bus = &dss_bus_type; dssdev->dev.parent = parent; dssdev->dev.release = omap_dss_dev_release; - dev_set_name(&dssdev->dev, "display%d", disp_num); + dev_set_name(&dssdev->dev, "display%d", disp_num_counter++); return device_register(&dssdev->dev); } diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 5ccce9b69e4..703fc1d8ec8 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -388,7 +388,7 @@ static void __init dpi_probe_pdata(struct platform_device *pdev) continue; } - r = omap_dss_register_device(dssdev, &pdev->dev, i); + r = omap_dss_register_device(dssdev, &pdev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 8d815e39e45..f7078fc9045 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -5027,7 +5027,7 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev) continue; } - r = omap_dss_register_device(dssdev, &dsidev->dev, i); + r = omap_dss_register_device(dssdev, &dsidev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 5e9fd769172..7bac8ee078a 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -185,7 +185,7 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput); int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)); int omap_dss_register_device(struct omap_dss_device *dssdev, - struct device *parent, int disp_num); + struct device *parent); void omap_dss_unregister_device(struct omap_dss_device *dssdev); void omap_dss_unregister_child_devices(struct device *parent); diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 83f18458a40..bb07143a2d7 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -923,7 +923,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) continue; } - r = omap_dss_register_device(dssdev, &pdev->dev, i); + r = omap_dss_register_device(dssdev, &pdev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 2e520d3085c..845b4e70a28 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -959,7 +959,7 @@ static void __init rfbi_probe_pdata(struct platform_device *pdev) continue; } - r = omap_dss_register_device(dssdev, &pdev->dev, i); + r = omap_dss_register_device(dssdev, &pdev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 66c8de4365d..c9a9045e19f 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c @@ -212,7 +212,7 @@ static void __init sdi_probe_pdata(struct platform_device *pdev) continue; } - r = omap_dss_register_device(dssdev, &pdev->dev, i); + r = omap_dss_register_device(dssdev, &pdev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 17b31029a79..60bfc580163 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -752,7 +752,7 @@ static void __init venc_probe_pdata(struct platform_device *pdev) continue; } - r = omap_dss_register_device(dssdev, &pdev->dev, i); + r = omap_dss_register_device(dssdev, &pdev->dev); if (r) DSSERR("device %s register failed: %d\n", dssdev->name, r); -- 2.46.0