]> www.infradead.org Git - users/dwmw2/linux.git/commit
Staging: fbtft: Fix probing of gpio descriptor
authorPhil Reid <preid@electromag.com.au>
Tue, 16 Jul 2019 00:24:36 +0000 (08:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:10:50 +0000 (10:10 +0200)
commit3558601e5bf93c153065fd8616d89d807600b566
treec41cd4bdc0c31c3d3b90a2f4be9c7e9ec5dad80d
parent35921421fb25805dd7fb9adb702d1ff7e5653632
Staging: fbtft: Fix probing of gpio descriptor

commit dbc4f989c878fe101fb7920e9609e8ec44e097cd upstream.

Conversion to use gpio descriptors broke all gpio lookups as
devm_gpiod_get_index was converted to use dev->driver->name for
the gpio name lookup. Fix this by using the name param. In
addition gpiod_get post-fixes the -gpios to the name so that
shouldn't be included in the call. However this then breaks the
of_find_property call to see if the gpio entry exists as all
fbtft treats all gpios as optional. So use devm_gpiod_get_index_optional
instead which achieves the same thing and is simpler.

Nishad confirmed the changes where only ever compile tested.

Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Jan Sebastian Götte <linux@jaseg.net>
Signed-off-by: Phil Reid <preid@electromag.com.au>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1563236677-5045-2-git-send-email-preid@electromag.com.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-core.c