From: 黄涛 Date: Mon, 16 Jun 2014 13:48:58 +0000 (+0800) Subject: video: rockchip: display-sys: fix compilation warning X-Git-Tag: firefly_0821_release~5086 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3d8b327e0effe18bd7b47e90b03a0f4ec8480e0d;p=firefly-linux-kernel-4.4.55.git video: rockchip: display-sys: fix compilation warning --- diff --git a/drivers/video/rockchip/display-sys.c b/drivers/video/rockchip/display-sys.c index 738b5689f81c..932cec6853e4 100644 --- a/drivers/video/rockchip/display-sys.c +++ b/drivers/video/rockchip/display-sys.c @@ -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);