]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
dt
authorseantywork <seantywork@gmail.com>
Tue, 18 Nov 2025 00:28:10 +0000 (00:28 +0000)
committerseantywork <seantywork@gmail.com>
Tue, 18 Nov 2025 00:28:10 +0000 (00:28 +0000)
kdev-gpio-dt/kdev_gpio.c

index bf94806c0da78d4b394f9dad4baaa52c39ff22e6..20320c22f805370422e55c8fb493153c65b61a82 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <linux/device.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/gpio/consumer.h>
@@ -41,24 +42,7 @@ static int __init kdev_gpio_init(void){
             }
         }
     }
-    struct device* d = container_of(&dn,struct device, of_node);
-    if(d == NULL){
-        of_node_put(dn);
-        printk("failed to get device\n");
-        return -1;
-    }
-    if(d->init_name != NULL){
-        printk("device init name: %s\n", d->init_name);
-    }
-    struct gpio_chip* gc = container_of(&d,struct gpio_chip, parent);
-    if(gc != NULL){
-        printk("got gc\n");
-        if(gc->label != NULL){
-            printk("gc label: %d\n", gc->base);
-        }
-    }
 
-    printk("kdev_gpio: init\n");
     return 0;
 }