]> git.baikalelectronics.ru Git - kernel.git/commit
staging: mt7621-pci: be sure gpio descriptor is null on fails
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Fri, 20 Mar 2020 11:01:23 +0000 (12:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 14:10:51 +0000 (15:10 +0100)
commitcaa670bbf5073211dc9dc544a7799d3d08456876
tree5f10705a36be53cdd33a20ff681ef542cf1391eb
parent672bf5f093f96464f5b32f76762f1b8584b1a376
staging: mt7621-pci: be sure gpio descriptor is null on fails

Function 'devm_gpiod_get_index_optional' returns NULL if the
descriptor is invalid and the error associated for the error
pointer is ENOENT. Sometimes if the pin is just assigned the
error associated for the pointer might not be ENOENT but other.
In order to avoid weirds behaviours if this happen set descriptor
to NULL in the driver port structure.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200320110123.9907-6-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pci/pci-mt7621.c