Skip to content

Commit b809315

Browse files
Bartosz GolaszewskiVudentz
authored andcommitted
Bluetooth: hci_qca: unduplicate calls to hci_uart_register_device()
Now that all three branches of the switch end up doing the same thing, we can move the call to hci_uart_register_device() past it and unify the error message. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent b80f4e3 commit b809315

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,25 +2396,13 @@ static int qca_serdev_probe(struct serdev_device *serdev)
23962396
dev_err(&serdev->dev, "failed to acquire clk\n");
23972397
return PTR_ERR(qcadev->susclk);
23982398
}
2399-
2400-
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
2401-
if (err) {
2402-
BT_ERR("wcn3990 serdev registration failed");
2403-
return err;
2404-
}
24052399
break;
24062400

24072401
case QCA_QCA6390:
24082402
qcadev->bt_power->pwrseq = devm_pwrseq_get(&serdev->dev,
24092403
"bluetooth");
24102404
if (IS_ERR(qcadev->bt_power->pwrseq))
24112405
return PTR_ERR(qcadev->bt_power->pwrseq);
2412-
2413-
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
2414-
if (err) {
2415-
BT_ERR("qca6390 serdev registration failed");
2416-
return err;
2417-
}
24182406
break;
24192407

24202408
default:
@@ -2447,11 +2435,12 @@ static int qca_serdev_probe(struct serdev_device *serdev)
24472435
if (err)
24482436
return err;
24492437

2450-
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
2451-
if (err) {
2452-
BT_ERR("Rome serdev registration failed");
2453-
return err;
2454-
}
2438+
}
2439+
2440+
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
2441+
if (err) {
2442+
BT_ERR("serdev registration failed");
2443+
return err;
24552444
}
24562445

24572446
hdev = qcadev->serdev_hu.hdev;

0 commit comments

Comments
 (0)