drm/etnaviv: remove _unlocked suffix in drm_gem_object_put_unlocked
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 15 May 2020 09:50:57 +0000 (10:50 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 May 2020 21:31:32 +0000 (22:31 +0100)
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-18-emil.l.velikov@gmail.com
drivers/gpu/drm/etnaviv/etnaviv_drv.c
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c

index 27c948f5dfeb7ea0baf55339a19aa2727b35f50f..a2b649a8248e9868dc23c1e87b8d445bc92fdf88 100644 (file)
@@ -289,7 +289,7 @@ static int etnaviv_ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
 
        ret = etnaviv_gem_cpu_prep(obj, args->op, &args->timeout);
 
-       drm_gem_object_put_unlocked(obj);
+       drm_gem_object_put(obj);
 
        return ret;
 }
@@ -310,7 +310,7 @@ static int etnaviv_ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
 
        ret = etnaviv_gem_cpu_fini(obj);
 
-       drm_gem_object_put_unlocked(obj);
+       drm_gem_object_put(obj);
 
        return ret;
 }
@@ -330,7 +330,7 @@ static int etnaviv_ioctl_gem_info(struct drm_device *dev, void *data,
                return -ENOENT;
 
        ret = etnaviv_gem_mmap_offset(obj, &args->offset);
-       drm_gem_object_put_unlocked(obj);
+       drm_gem_object_put(obj);
 
        return ret;
 }
@@ -413,7 +413,7 @@ static int etnaviv_ioctl_gem_wait(struct drm_device *dev, void *data,
 
        ret = etnaviv_gem_wait_bo(gpu, obj, timeout);
 
-       drm_gem_object_put_unlocked(obj);
+       drm_gem_object_put(obj);
 
        return ret;
 }
index dc9ef302f517607f7d0b7ef98595c8bfa393dbfd..b9bfb50ce7ee18d0cb4f23084c2c8c5fc0cb69b4 100644 (file)
@@ -244,7 +244,7 @@ void etnaviv_gem_mapping_unreference(struct etnaviv_vram_mapping *mapping)
        mapping->use -= 1;
        mutex_unlock(&etnaviv_obj->lock);
 
-       drm_gem_object_put_unlocked(&etnaviv_obj->base);
+       drm_gem_object_put(&etnaviv_obj->base);
 }
 
 struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
@@ -633,7 +633,7 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file,
 
        /* drop reference from allocate - handle holds it now */
 fail:
-       drm_gem_object_put_unlocked(obj);
+       drm_gem_object_put(obj);
 
        return ret;
 }
@@ -742,6 +742,6 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file,
        ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle);
 
        /* drop reference from allocate - handle holds it now */
-       drm_gem_object_put_unlocked(&etnaviv_obj->base);
+       drm_gem_object_put(&etnaviv_obj->base);
        return ret;
 }
index f24dd21c2363bc8231bd4445bb5d85ebe9440c4e..6d9e5c3c4dd5738a90617f74d59d73d26ec9c364 100644 (file)
@@ -136,7 +136,7 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
        return &etnaviv_obj->base;
 
 fail:
-       drm_gem_object_put_unlocked(&etnaviv_obj->base);
+       drm_gem_object_put(&etnaviv_obj->base);
 
        return ERR_PTR(ret);
 }
index 3b0afa156d92994ad21aef0d910e95b6f0a45240..1b12b57d24067ca56174568d2f689eee6657b342 100644 (file)
@@ -396,7 +396,7 @@ static void submit_cleanup(struct kref *kref)
 
                /* if the GPU submit failed, objects might still be locked */
                submit_unlock_object(submit, i);
-               drm_gem_object_put_unlocked(&etnaviv_obj->base);
+               drm_gem_object_put(&etnaviv_obj->base);
        }
 
        wake_up_all(&submit->gpu->fence_event);