Re: [PATCH v3 07/11] gpiolib: replace find_chip_by_name() with gpio_device_find_by_label()

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

 



On Fri, Sep 15, 2023 at 05:03:22PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> 
> Remove all remaining uses of find_chip_by_name() (and subsequently:
> gpiochip_find()) from gpiolib.c and use the new
> gpio_device_find_by_label() instead.

...

> -static int gpiochip_match_name(struct gpio_chip *gc, void *data)
> -{
> -	const char *name = data;
> -
> -	return !strcmp(gc->label, name);

And this we had no check for the label being NULL...

...

>  	for (p = &table->table[0]; p->key; p++) {
> +		struct gpio_device *gdev __free(gpio_device_put) = NULL;

> +		gdev = gpio_device_find_by_label(p->key);
> +		if (!gdev) {

I haven't got the fix for gpio-sim, shouldn't we have the same here, i.e.
definition being done together with the assignment when __free() is in use?

>  		}

-- 
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