Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 493e1095 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "btfm: cleanup slimbus device node in failure scenerios"

parents 89027db4 bcf528a8
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -496,9 +496,18 @@ static int btfm_slim_probe(struct slim_device *slim)
	/* Driver specific data allocation */
	btfm_slim->dev = &slim->dev;
	ret = btfm_slim_register_codec(&slim->dev);
	if (ret) {
		BTFMSLIM_ERR("error, registering slimbus codec failed");
		goto free;
	}
	ret = bt_register_slimdev(&slim->dev);
	if (ret < 0) {
		btfm_slim_unregister_codec(&slim->dev);
		goto free;
	}
	return ret;

free:
	slim_remove_device(&btfm_slim->slim_ifd);
dealloc:
	mutex_destroy(&btfm_slim->io_lock);
	mutex_destroy(&btfm_slim->xfer_lock);
+8 −0
Original line number Diff line number Diff line
@@ -162,4 +162,12 @@ int btfm_slim_disable_ch(struct btfmslim *btfmslim,
 * 0
 */
int btfm_slim_register_codec(struct device *dev);

/**
 * btfm_slim_unregister_codec: Unregister codec driver in slimbus device node
 * @dev: device node
 * Returns:
 * VOID
 */
void btfm_slim_unregister_codec(struct device *dev);
#endif /* BTFM_SLIM_H */
+7 −0
Original line number Diff line number Diff line
@@ -462,5 +462,12 @@ int btfm_slim_register_codec(struct device *dev)
	return ret;
}

void btfm_slim_unregister_codec(struct device *dev)
{
	BTFMSLIM_DBG("");
	/* Unregister Codec driver */
	snd_soc_unregister_codec(dev);
}

MODULE_DESCRIPTION("BTFM Slimbus Codec driver");
MODULE_LICENSE("GPL v2");