From 3d8b327e0effe18bd7b47e90b03a0f4ec8480e0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 16 Jun 2014 21:48:58 +0800 Subject: [PATCH] video: rockchip: display-sys: fix compilation warning --- drivers/video/rockchip/display-sys.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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); -- 2.34.1