Skip to content

Commit 4a92857

Browse files
krzkBartosz Golaszewski
authored andcommitted
gpio: constify opaque pointer "data" in gpio_device_find()
The opaque pointer "data" in each match function used by gpio_device_find() is a pointer to const, thus the same argument passed to gpio_device_find() can adjusted similarly. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 91510d5 commit 4a92857

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpio/gpiolib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ EXPORT_SYMBOL_GPL(gpiochip_remove);
11711171
* If the function returns non-NULL, the returned reference must be freed by
11721172
* the caller using gpio_device_put().
11731173
*/
1174-
struct gpio_device *gpio_device_find(void *data,
1174+
struct gpio_device *gpio_device_find(const void *data,
11751175
int (*match)(struct gpio_chip *gc,
11761176
const void *data))
11771177
{

include/linux/gpio/driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc,
628628
void *data, struct lock_class_key *lock_key,
629629
struct lock_class_key *request_key);
630630

631-
struct gpio_device *gpio_device_find(void *data,
631+
struct gpio_device *gpio_device_find(const void *data,
632632
int (*match)(struct gpio_chip *gc,
633633
const void *data));
634634
struct gpio_device *gpio_device_find_by_label(const char *label);

0 commit comments

Comments
 (0)