mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
video: rockchip: display-sys: Add the same display interface device naming convention
When multiple same type display interface is registered, such as TV, named TV, TV1, TV2. Change-Id: I33f7e12c4942c3bf7eb29cca8ef6037f9e78d1af Signed-off-by: Shen Zhenyi <szy@rock-chips.com>
This commit is contained in:
committed by
Gerrit Code Review
parent
bc2d3a7a84
commit
c196bbf342
@@ -649,10 +649,31 @@ struct rk_display_device
|
||||
mutex_unlock(&allocated_dsp_lock);
|
||||
|
||||
if (new_dev->idx >= 0) {
|
||||
new_dev->dev =
|
||||
device_create(display_class, parent,
|
||||
MKDEV(0, 0), new_dev,
|
||||
"%s", new_dev->type);
|
||||
struct list_head *pos, *head;
|
||||
struct rk_display_device *dev;
|
||||
int i = 0;
|
||||
|
||||
head = &main_display_device_list;
|
||||
list_for_each_entry(dev, head, list) {
|
||||
if (strcmp(dev->type, new_dev->type) == 0)
|
||||
i++;
|
||||
}
|
||||
head = &aux_display_device_list;
|
||||
list_for_each_entry(dev, head, list) {
|
||||
if (strcmp(dev->type, new_dev->type) == 0)
|
||||
i++;
|
||||
}
|
||||
if (i == 0)
|
||||
new_dev->dev =
|
||||
device_create(display_class, parent,
|
||||
MKDEV(0, 0), new_dev,
|
||||
"%s", new_dev->type);
|
||||
else
|
||||
new_dev->dev =
|
||||
device_create(display_class, parent,
|
||||
MKDEV(0, 0), new_dev,
|
||||
"%s%d", new_dev->type, i);
|
||||
|
||||
if (!IS_ERR(new_dev->dev)) {
|
||||
new_dev->parent = parent;
|
||||
new_dev->driver = driver;
|
||||
@@ -660,10 +681,6 @@ struct rk_display_device
|
||||
new_dev->dev->driver = parent->driver;
|
||||
mutex_init(&new_dev->lock);
|
||||
/* Add new device to display device list. */
|
||||
{
|
||||
struct list_head *pos, *head;
|
||||
struct rk_display_device *dev;
|
||||
|
||||
if (new_dev->property == DISPLAY_MAIN)
|
||||
head = &main_display_device_list;
|
||||
else
|
||||
@@ -679,7 +696,6 @@ struct rk_display_device
|
||||
}
|
||||
list_add_tail(&new_dev->list, pos);
|
||||
return new_dev;
|
||||
}
|
||||
}
|
||||
mutex_lock(&allocated_dsp_lock);
|
||||
idr_remove(&allocated_dsp, new_dev->idx);
|
||||
|
||||
Reference in New Issue
Block a user