Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon mutex init/destroy



details:   https://anonhg.NetBSD.org/src/rev/5dc530e51575
branches:  trunk
changeset: 366081:5dc530e51575
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:46:38 2018 +0000

description:
mutex init/destroy

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r 82e456b8ec56 -r 5dc530e51575 sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c        Mon Aug 27 07:46:28 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c        Mon Aug 27 07:46:38 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_i2c.c,v 1.4 2018/08/27 04:58:36 riastradh Exp $ */
+/*     $NetBSD: radeon_i2c.c,v 1.5 2018/08/27 07:46:38 riastradh Exp $ */
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *          Alex Deucher
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_i2c.c,v 1.4 2018/08/27 04:58:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_i2c.c,v 1.5 2018/08/27 07:46:38 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/module.h>
@@ -933,7 +933,11 @@
        i2c->adapter.dev.parent = dev->dev;
        i2c->dev = dev;
        i2c_set_adapdata(&i2c->adapter, i2c);
+#ifdef __NetBSD__
+       linux_mutex_init(&i2c->mutex);
+#else
        mutex_init(&i2c->mutex);
+#endif
        if (rec->mm_i2c ||
            (rec->hw_capable &&
             radeon_hw_i2c &&
@@ -983,6 +987,11 @@
 
        return i2c;
 out_free:
+#ifdef __NetBSD__
+       linux_mutex_destroy(&i2c->mutex);
+#else
+       mutex_destroy(&i2c->mutex);
+#endif
        kfree(i2c);
        return NULL;
 
@@ -995,6 +1004,11 @@
        i2c_del_adapter(&i2c->adapter);
        if (i2c->has_aux)
                drm_dp_aux_unregister(&i2c->aux);
+#ifdef __NetBSD__
+       linux_mutex_destroy(&i2c->mutex);
+#else
+       mutex_destroy(&i2c->mutex);
+#endif
        kfree(i2c);
 }
 



Home | Main Index | Thread Index | Old Index