diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-03-15 10:33:29 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-06-17 07:00:49 -0400 |
commit | 67b23ca1b6a870100e258376cad250f10997ecf7 (patch) | |
tree | 7583539154af85ff683a7492fff853a9a153a2c5 /drivers/video/omap2/dss/display.c | |
parent | 2e7e3dc79492953c2c1192d8d4129ac86ee70aec (diff) |
OMAPDSS: use the panel list in omap_dss_get_next_device
omap_dss_get_next_device() uses the dss bus to iterate over the
displays. This patch changes omap_dss_get_next_device() to use the new
panel list instead.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/display.c')
-rw-r--r-- | drivers/video/omap2/dss/display.c | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 1c175a4e7f6b..ba83ec3bfc8c 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -191,27 +191,51 @@ void omap_dss_put_device(struct omap_dss_device *dssdev) | |||
191 | } | 191 | } |
192 | EXPORT_SYMBOL(omap_dss_put_device); | 192 | EXPORT_SYMBOL(omap_dss_put_device); |
193 | 193 | ||
194 | /* ref count of the found device is incremented. ref count | 194 | /* |
195 | * of from-device is decremented. */ | 195 | * ref count of the found device is incremented. |
196 | * ref count of from-device is decremented. | ||
197 | */ | ||
196 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from) | 198 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from) |
197 | { | 199 | { |
198 | struct device *dev; | 200 | struct list_head *l; |
199 | struct device *dev_start = NULL; | 201 | struct omap_dss_device *dssdev; |
200 | struct omap_dss_device *dssdev = NULL; | 202 | |
203 | mutex_lock(&panel_list_mutex); | ||
201 | 204 | ||
202 | int match(struct device *dev, void *data) | 205 | if (list_empty(&panel_list)) { |
203 | { | 206 | dssdev = NULL; |
204 | return 1; | 207 | goto out; |
205 | } | 208 | } |
206 | 209 | ||
207 | if (from) | 210 | if (from == NULL) { |
208 | dev_start = &from->dev; | 211 | dssdev = list_first_entry(&panel_list, struct omap_dss_device, |
209 | dev = bus_find_device(dss_get_bus(), dev_start, NULL, match); | 212 | panel_list); |
210 | if (dev) | 213 | omap_dss_get_device(dssdev); |
211 | dssdev = to_dss_device(dev); | 214 | goto out; |
212 | if (from) | 215 | } |
213 | put_device(&from->dev); | 216 | |
217 | omap_dss_put_device(from); | ||
218 | |||
219 | list_for_each(l, &panel_list) { | ||
220 | dssdev = list_entry(l, struct omap_dss_device, panel_list); | ||
221 | if (dssdev == from) { | ||
222 | if (list_is_last(l, &panel_list)) { | ||
223 | dssdev = NULL; | ||
224 | goto out; | ||
225 | } | ||
226 | |||
227 | dssdev = list_entry(l->next, struct omap_dss_device, | ||
228 | panel_list); | ||
229 | omap_dss_get_device(dssdev); | ||
230 | goto out; | ||
231 | } | ||
232 | } | ||
214 | 233 | ||
234 | WARN(1, "'from' dssdev not found\n"); | ||
235 | |||
236 | dssdev = NULL; | ||
237 | out: | ||
238 | mutex_unlock(&panel_list_mutex); | ||
215 | return dssdev; | 239 | return dssdev; |
216 | } | 240 | } |
217 | EXPORT_SYMBOL(omap_dss_get_next_device); | 241 | EXPORT_SYMBOL(omap_dss_get_next_device); |