]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
gpio chip
authorseantywork <seantywork@gmail.com>
Fri, 14 Nov 2025 07:47:42 +0000 (16:47 +0900)
committerseantywork <seantywork@gmail.com>
Fri, 14 Nov 2025 07:47:42 +0000 (16:47 +0900)
kdev-gpio/kdev_gpio.c

index 554307554f8ecb5400bf016f8099a86c5ecd1637..a80f137063b771bae05e7414e7f6788bdcbc717a 100644 (file)
@@ -27,7 +27,7 @@ static int __init kdev_gpio_init(void){
     struct device_node* dn = NULL;
     struct device* d = NULL;
     struct gpio_desc* gd = NULL;
-    dn = of_find_node_by_name(NULL, "gpio");
+    dn = of_find_node_by_name(NULL, "gpiochip0");
     if(dn == NULL){
         printk("failed to find device node: gpio\n");
         return -1;
@@ -37,7 +37,7 @@ static int __init kdev_gpio_init(void){
         printk("failed to get device from node\n");
         return -1;
     }
-    gd = gpiod_get(d, NULL, 0);
+    gd = gpiod_get(d, "GPIO17", 0);
     if(IS_ERR(gd)){
         printk("failed to get desc\n");
         return -1;