summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-moxtet.c
diff options
context:
space:
mode:
authorRodrigo Alencar <455.rodrigo.alencar@gmail.com>2020-05-14 16:00:12 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-05-22 18:01:25 +0300
commit47a3734b03904bbccbba0c8f78cf2b0f0aa157e7 (patch)
treea8f48093f23c5117d6ccc7eceb9a52d40bf157e3 /drivers/gpio/gpio-moxtet.c
parent3831c051dfbf58595085e432acc00ad4efcf54cc (diff)
downloadlinux-47a3734b03904bbccbba0c8f78cf2b0f0aa157e7.tar.xz
gpio: max730x: bring gpiochip_add_data after port config
gpiochip_add_data being called before might cause premature calls of the gpiochip operations before the port_config values are initialized, which would possibily write zeros to port configuration registers, an operation not allowed. For example, if there are gpio-hog nodes in a device-tree, the sequence of function calls are performed gpiochip_add_data of_gpiochip_add of_gpiochip_scan_gpios of_gpiochip_add_hog gpiod_hog gpiochip_request_own_desc gpiod_configure_flags gpiod_direction_output/gpiod_direction_input which would call later the gpiochip operation direction_output or direction_input prior the port_config[] initialization. Moreover, gpiochip_get_data is replaced by the container_of macro inside the gpiochip operations, which would allow the calling of max7301_direction_input prior to gpiochip_add_data Signed-off-by: Rodrigo Alencar <455.rodrigo.alencar@gmail.com> [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpio-moxtet.c')
0 files changed, 0 insertions, 0 deletions