Message ID | 20240220072602.36111-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers | show |
Series | gpio: constify of_phandle_args in of_find_gpio_device_by_xlate() | expand |
On Tue, Feb 20, 2024 at 8:26 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > Pointer to the struct of_phandle_args can be made const after > gpio_device_find() arguments got constified. This should be part of > commit 4a92857d6e83 ("gpio: constify opaque pointer "data" in > gpio_device_find()"). > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > I mixed up chunks of patches, because this should be in previous commit > 4a92857d6e83 ("gpio: constify opaque pointer "data" in"). Sorry for > that. > --- > drivers/gpio/gpiolib-of.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c > index 523b047a2803..e35a9c7da4ee 100644 > --- a/drivers/gpio/gpiolib-of.c > +++ b/drivers/gpio/gpiolib-of.c > @@ -129,7 +129,7 @@ static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, > } > > static struct gpio_device * > -of_find_gpio_device_by_xlate(struct of_phandle_args *gpiospec) > +of_find_gpio_device_by_xlate(const struct of_phandle_args *gpiospec) > { > return gpio_device_find(gpiospec, of_gpiochip_match_node_and_xlate); > } > -- > 2.34.1 > Applied, thanks! Bart
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 523b047a2803..e35a9c7da4ee 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -129,7 +129,7 @@ static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, } static struct gpio_device * -of_find_gpio_device_by_xlate(struct of_phandle_args *gpiospec) +of_find_gpio_device_by_xlate(const struct of_phandle_args *gpiospec) { return gpio_device_find(gpiospec, of_gpiochip_match_node_and_xlate); }
Pointer to the struct of_phandle_args can be made const after gpio_device_find() arguments got constified. This should be part of commit 4a92857d6e83 ("gpio: constify opaque pointer "data" in gpio_device_find()"). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- I mixed up chunks of patches, because this should be in previous commit 4a92857d6e83 ("gpio: constify opaque pointer "data" in"). Sorry for that. --- drivers/gpio/gpiolib-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)