]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 8 Feb 2024 16:40:17 +0000 (17:40 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:37 +0000 (18:19 -0400)
commit988b77ba0df06b9c995d947ea29f0e13646f44f7
tree1dfe9dbe01d7ffe4aa327ed4649e0faa93ec5a85
parent0b3df53c9d3a1a24ab6d1c0b4b54c14b458f0b65
Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()

[ Upstream commit 56d074d26c5828773b00b2185dd7e1d08273b8e8 ]

The optional variants for the gpiod_get() family of functions return NULL
if the GPIO in question is not associated with this device. They return
ERR_PTR() on any other error. NULL descriptors are graciously handled by
GPIOLIB and can be safely passed to any of the GPIO consumer interfaces
as they will return 0 and act as if the function succeeded. If one is
using the optional variant, then there's no point in checking for NULL.

Fixes: 6845667146a2 ("Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/hci_qca.c