video: rockchip: display-sys: fix compilation warning

This commit is contained in:
黄涛
2014-06-16 21:48:58 +08:00
parent f76a860c34
commit 3d8b327e0e

View File

@@ -353,20 +353,14 @@ struct rk_display_device *rk_display_device_register(struct rk_display_driver *d
if (unlikely(!driver))
return ERR_PTR(ret);
mutex_lock(&allocated_dsp_lock);
ret = idr_pre_get(&allocated_dsp, GFP_KERNEL);
mutex_unlock(&allocated_dsp_lock);
if (!ret)
return ERR_PTR(ret);
new_dev = kzalloc(sizeof(struct rk_display_device), GFP_KERNEL);
if (likely(new_dev) && unlikely(driver->probe(new_dev, devdata))) {
// Reserve the index for this display
mutex_lock(&allocated_dsp_lock);
ret = idr_get_new(&allocated_dsp, new_dev, &new_dev->idx);
new_dev->idx = idr_alloc(&allocated_dsp, new_dev, 0, 0, GFP_KERNEL);
mutex_unlock(&allocated_dsp_lock);
if (!ret) {
if (new_dev->idx >= 0) {
new_dev->dev = device_create(display_class, parent,
MKDEV(0, 0), new_dev,
"%s", new_dev->type);