Skip to content

Commit e2e38c5

Browse files
Bartosz Golaszewskigregkh
authored andcommitted
Bluetooth: hci_qca: move the SoC type check to the right place
commit 0fb410c upstream. Commit 3d05fc8 ("Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional()") accidentally changed the prevous behavior where power control would be disabled without the BT_EN GPIO only on QCA_WCN6750 and QCA_WCN6855 while also getting the error check wrong. We should treat every IS_ERR() return value from devm_gpiod_get_optional() as a reason to bail-out while we should only set power_ctrl_enabled to false on the two models mentioned above. While at it: use dev_err_probe() to save a LOC. Cc: [email protected] Fixes: 3d05fc8 ("Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional()") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Tested-by: Hsin-chen Chuang <[email protected]> Reviewed-by: Hsin-chen Chuang <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b63f23f commit e2e38c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,14 +2307,14 @@ static int qca_serdev_probe(struct serdev_device *serdev)
23072307

23082308
qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable",
23092309
GPIOD_OUT_LOW);
2310-
if (IS_ERR(qcadev->bt_en) &&
2311-
(data->soc_type == QCA_WCN6750 ||
2312-
data->soc_type == QCA_WCN6855)) {
2313-
dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n");
2314-
return PTR_ERR(qcadev->bt_en);
2315-
}
2310+
if (IS_ERR(qcadev->bt_en))
2311+
return dev_err_probe(&serdev->dev,
2312+
PTR_ERR(qcadev->bt_en),
2313+
"failed to acquire BT_EN gpio\n");
23162314

2317-
if (!qcadev->bt_en)
2315+
if (!qcadev->bt_en &&
2316+
(data->soc_type == QCA_WCN6750 ||
2317+
data->soc_type == QCA_WCN6855))
23182318
power_ctrl_enabled = false;
23192319

23202320
qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl",

0 commit comments

Comments
 (0)