diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-02-08 21:27:04 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-02-12 10:18:31 +0100 |
commit | faf6efd2e5e23d3319501132d9671c8606ef21bd (patch) | |
tree | 8b698b9a557ea0eafb984ee1dc6337c24f62702e /include/linux/gpio | |
parent | Merge tag 'v6.8-rc4' into gpio/for-next (diff) | |
download | wireguard-linux-faf6efd2e5e23d3319501132d9671c8606ef21bd.tar.xz wireguard-linux-faf6efd2e5e23d3319501132d9671c8606ef21bd.zip |
gpio: constify opaque pointer in gpio_device_find() match function
The match function used in gpio_device_find() should not modify the
contents of passed opaque pointer, because such modification would not
be necessary for actual matching and it could lead to quite unreadable,
spaghetti code.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[Bartosz: fix coding style in header]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r-- | include/linux/gpio/driver.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 3a37d058cfcf..9d0023f83a57 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -629,7 +629,8 @@ int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, struct lock_class_key *request_key); struct gpio_device *gpio_device_find(void *data, - int (*match)(struct gpio_chip *gc, void *data)); + int (*match)(struct gpio_chip *gc, + const void *data)); struct gpio_device *gpio_device_find_by_label(const char *label); struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode); |