bindings: python: call gpiod_LineBulk_init() directly
authorBartosz Golaszewski <bartekgola@gmail.com>
Fri, 13 Jul 2018 13:57:25 +0000 (15:57 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Fri, 13 Jul 2018 13:58:27 +0000 (15:58 +0200)
Using the .tp_init callback is more complicated and unnecessary. Call
gpiod_LineBulk_init() directly from gpiod_ListToLineBulk().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
bindings/python/gpiodmodule.c

index b45ce6604a17a9f101ae36fe1ebdb633896825bc..0d10814527ad1d2f78902fc968addc25715b14bd 100644 (file)
@@ -1479,7 +1479,7 @@ static gpiod_LineBulkObject *gpiod_ListToLineBulk(PyObject *lines)
                return NULL;
        }
 
-       rv = gpiod_LineBulkType.tp_init((PyObject *)bulk, arg, NULL);
+       rv = gpiod_LineBulk_init(bulk, arg);
        Py_DECREF(arg);
        if (rv < 0) {
                Py_DECREF(bulk);