]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: addac: ad74413r: drop reset_gpio from struct ad74413r_state
authorNuno Sa <nuno.sa@analog.com>
Wed, 16 Oct 2024 14:21:59 +0000 (16:21 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Oct 2024 18:19:25 +0000 (19:19 +0100)
commite902145064ecdfa10935131fd427c4d455cf908f
tree433512ff5f75b2a0ee1fbc6d8d777e8cac97def5
parent14a4f5b4cfaec0d74e7dadb921c39907e86686b9
iio: addac: ad74413r: drop reset_gpio from struct ad74413r_state

We just need the reset gpio during probe so there's no need to keep it
in our state struct. Hence, move devm_gpiod_get_optional() into
ad74413r_reset() and use a local struct gpio_desc.

While at it, request the gpio in the asserted state (GPIOD_OUT_HIGH) so
that we already perform the reset while requesting the gpio saving us a
call to gpiod_set_value_cansleep().

Also, explicitly include <gpio/consumer.h> for
devm_gpiod_get_optional().

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241016-dev-ad74413r-minor-improv-v1-1-13c9c769237d@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/addac/ad74413r.c