Re: [PATCH v1 1/1] gpio: legacy: Kill gpio_set_value_cansleep()

[email protected]
Newsgroups dev.linux.lists.mfd
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Removal of `gpio_set_value_cansleep()` breaks the build for `drivers/mfd/si476x-i2c.c`.
--

--- Patch [1]: [PATCH v1 1/1] gpio: legacy: Kill gpio_set_value_cansleep() ---
commit 0128b6379880c534503058a0dec618848431c9df
Author: Andy Shevchenko <[email protected]>

gpio: legacy: Kill gpio_set_value_cansleep()

This commit removes the legacy gpio_set_value_cansleep() API. The commit
message notes that there are no more users and that it must go via the MFD
tree.

> diff --git a/include/linux/gpio/legacy.h b/include/linux/gpio/legacy.h
> index 557ef635935ea..4001208d5d636 100644
> --- a/include/linux/gpio/legacy.h
> +++ b/include/linux/gpio/legacy.h
> @@ -63,10 +63,6 @@ static inline int gpio_get_value_cansleep(unsigned gpio)
>  {
>  	return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio));
>  }
> -static inline void gpio_set_value_cansleep(unsigned gpio, int value)
> -{
> -	gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value);
> -}

[Severity: Low]
Does removing this function break the build for drivers/mfd/si476x-i2c.c?
There appear to be active callers of gpio_set_value_cansleep() that will
cause implicit declaration errors when CONFIG_MFD_SI476X_CORE is enabled.

For example, in si476x_core_start() on the success path:

drivers/mfd/si476x-i2c.c:si476x_core_start() {
    ...
	if (gpio_is_valid(core->gpio_reset))
		gpio_set_value_cansleep(core->gpio_reset, 1);
    ...
}

It is also called on the error handling path of si476x_core_start():

drivers/mfd/si476x-i2c.c:si476x_core_start() {
    ...
	if (gpio_is_valid(core->gpio_reset))
		gpio_set_value_cansleep(core->gpio_reset, 0);
    ...
}

And during core stop in si476x_core_stop():

drivers/mfd/si476x-i2c.c:si476x_core_stop() {
    ...
	if (gpio_is_valid(core->gpio_reset))
		gpio_set_value_cansleep(core->gpio_reset, 0);
    ...
}

[ ... ]
> @@ -148,12 +144,6 @@ static inline int gpio_get_value_cansleep(unsigned gpio)
>  	return 0;
>  }
>  
> -static inline void gpio_set_value_cansleep(unsigned gpio, int value)
> -{
> -	/* GPIO can never have been requested or set as output */
> -	WARN_ON(1);
> -}
> -
>  static inline int gpio_to_irq(unsigned gpio)
>  {
>  	/* GPIO can never have been requested or set as input */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.