From: Mark Brown Date: Thu, 13 Feb 2025 17:32:59 +0000 (+0000) Subject: gpiolib: add gpiod_multi_set_value_cansleep X-Git-Tag: v6.15-rc1~173^2~4^2~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74e0fcbd705d4277267311f8f26a00bb8ce93820;p=thirdparty%2Fkernel%2Flinux.git gpiolib: add gpiod_multi_set_value_cansleep Merge series from David Lechner : This series was inspired by some minor annoyance I have experienced a few times in recent reviews. Calling gpiod_set_array_value_cansleep() can be quite verbose due to having so many parameters. In most cases, we already have a struct gpio_descs that contains the first 3 parameters so we end up with 3 (or often even 6) pointer indirections at each call site. Also, people have a tendency to want to hard-code the first argument instead of using struct gpio_descs.ndescs, often without checking that ndescs >= the hard-coded value. So I'm proposing that we add a gpiod_multi_set_value_cansleep() function that is a wrapper around gpiod_set_array_value_cansleep() that has struct gpio_descs as the first parameter to make it a bit easier to read the code and avoid the hard-coding temptation. I've just done gpiod_multi_set_value_cansleep() for now since there were over 10 callers of this one. There aren't as many callers of the get and atomic variants, but we can add those too if this seems like a useful thing to do. Maintainers, if you prefer to have this go through the gpio tree, please give your Acked-by:. Several maintainers have also requested an immutable branch, so I expect that will be made available. And if there is anything leftover after the next kernel release, I will resend it. --- 74e0fcbd705d4277267311f8f26a00bb8ce93820