Re: [PATCH 03/21] gpiolib: provide gpio_device_find_by_label()

Andy Shevchenko <[email protected]> Wed, 6 Sep 2023 17:13:20 +0300
Newsgroups dev.linux.lists.timestamp,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-omap,org.kernel.vger.linux-tegra,org.kernel.vger.platform-driver-x86
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Message-ID <[email protected]>
On Tue, Sep 05, 2023 at 08:52:51PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
> 
> By far the most common way of looking up GPIO devices is using their
> label. Provide a helpers for that to avoid every user implementing their
> own matching function.

...

> +/**
> + * gpio_device_find_by_label() - wrapper around gpio_device_find() finding the
> + *                               GPIO device by its backing chip's label
> + * @label: Label to lookup
> + *
> + * Returns:
> + * Reference to the GPIO device or NULL. Reference must be released with

> + * ``gpio_device_put``.

Out of a sudden different format to refer the function.
Should be gpio_device_put(), so kernel-doc makes a hyperlink.

> + */

So, please, render all your kernel docs and look at the end result.

...

> +	return gpio_device_find((void *)label, gpio_chip_match_by_label);

This casting is a bit awkward... But I have no good proposal for a change.

-- 
With Best Regards,
Andy Shevchenko