Skip to content
Commit 4785948b authored by Michal Vokáč's avatar Michal Vokáč Committed by Greg Kroah-Hartman
Browse files

net: dsa: qca8k: fix illegal usage of GPIO



[ Upstream commit c44fc98f ]

When working with GPIO, its direction must be set either when the GPIO is
requested by gpiod_get*() or later on by one of the gpiod_direction_*()
functions. Neither of this is done here which results in undefined
behavior on some systems.

As the reset GPIO is used right after it is requested here, it makes sense
to configure it as GPIOD_OUT_HIGH right away. With that, the following
gpiod_set_value_cansleep(1) becomes redundant and can be safely
removed.

Fixes: a653f2f5 ("net: dsa: qca8k: introduce reset via gpio feature")
Signed-off-by: default avatarMichal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/1706266175-3408-1-git-send-email-michal.vokac@ysoft.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a4b6f9de
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment