Re: [PATCH v2 08/10] pinctrl: sppctl: use gpiochip_dup_line_label()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 30, 2023 at 02:46:28PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> 
> Use the new gpiochip_dup_line_label() helper to safely retrieve the
> descriptor label.

...

>  	for (i = 0; i < chip->ngpio; i++) {
> -		label = gpiochip_is_requested(chip, i);
> -		if (!label)
> -			label = "";
> +		char *label __free(kfree) = gpiochip_dup_line_label(chip, i);
> +		if (IS_ERR(label))
> +			continue;
>  
>  		seq_printf(s, " gpio-%03d (%-16.16s | %-16.16s)", i + chip->base,
> -			   chip->names[i], label);
> +			   chip->names[i], label ?: "");

So, as it's non-ABI change, we still can use "reserved" word here as well
("Unrequested" or whatever.)

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux