]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gpio: pxa: handle corner case of unprobed device
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 25 Aug 2018 08:44:17 +0000 (10:44 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitc63f20780f2d6dd993836d823f70b7b018736f24
tree0254c09e452c7aa657cf74dc0ec22106b092d792
parent80a37e407e1bc983d96a85edf5ba6040293f1d67
gpio: pxa: handle corner case of unprobed device

BugLink: https://bugs.launchpad.net/bugs/1838349
[ Upstream commit 9ce3ebe973bf4073426f35f282c6b955ed802765 ]

In the corner case where the gpio driver probe fails, for whatever
reason, the suspend and resume handlers will still be called as they
have to be registered as syscore operations. This applies as well when
no probe was called while the driver has been built in the kernel.

Nicolas tracked this in :
https://bugzilla.kernel.org/show_bug.cgi?id=200905

Therefore, add a failsafe in these function, and test if a proper probe
succeeded and the driver is functional.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reported-by: Nicolas Chauvet <kwizart@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpio/gpio-pxa.c