#include <linux/acpi.h>
 #include <linux/array_size.h>
 #include <linux/bitops.h>
+#include <linux/cleanup.h>
 #include <linux/gpio/driver.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
                const char *pull_str = NULL;
                const char *pull = NULL;
                unsigned long flags;
-               const char *label;
                unsigned int pin;
 
                pin = vg->soc->pins[i].number;
                        seq_printf(s, "Pin %i: can't retrieve community\n", pin);
                        continue;
                }
-               label = gpiochip_is_requested(chip, i);
-               if (!label)
-                       label = "Unrequested";
+
+               char *label __free(kfree) = gpiochip_dup_line_label(chip, i);
+               if (IS_ERR(label))
+                       continue;
 
                switch (conf0 & BYT_PULL_ASSIGN_MASK) {
                case BYT_PULL_ASSIGN_UP:
                seq_printf(s,
                           " gpio-%-3d (%-20.20s) %s %s %s pad-%-3d offset:0x%03x mux:%d %s%s%s",
                           pin,
-                          label,
+                          label ?: "Unrequested",
                           val & BYT_INPUT_EN ? "  " : "in",
                           val & BYT_OUTPUT_EN ? "   " : "out",
                           str_hi_lo(val & BYT_LEVEL),