···88 *99 */10101111+#include <linux/cleanup.h>1112#include <linux/kernel.h>1213#include <linux/slab.h>1314#include <linux/module.h>···194193 for (i = 0; i < chip->ngpio; i++) {195194 int gpio = i + chip->base;196195 int reg;197197- const char *label;198196199197 /* We report the GPIO even if it's not requested since200198 * we're also reporting things like alternate201199 * functions which apply even when the GPIO is not in202200 * use as a GPIO.203201 */204204- label = gpiochip_is_requested(chip, i);205205- if (!label)206206- label = "Unrequested";202202+ char *label __free(kfree) = gpiochip_dup_line_label(chip, i);203203+ if (IS_ERR(label)) {204204+ dev_err(wm8994->dev, "Failed to duplicate label\n");205205+ continue;206206+ }207207208208- seq_printf(s, " gpio-%-3d (%-20.20s) ", gpio, label);208208+ seq_printf(s, " gpio-%-3d (%-20.20s) ", gpio,209209+ label ?: "Unrequested");209210210211 reg = wm8994_reg_read(wm8994, WM8994_GPIO_1 + i);211212 if (reg < 0) {