lkml.org 
[lkml]   [2020]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpio: gpio-max730x: bring gpiochip_add_data after port config
czw., 14 maj 2020 o 15:00 Rodrigo Alencar
<455.rodrigo.alencar@gmail.com> napisał(a):
>
> 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 gonfiguration 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>

Applied with some tweaks to the commit message.

Bartosz

\
 
 \ /
  Last update: 2020-05-22 17:03    [W:0.036 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site