Unverified Commit 772ed12b authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown
Browse files

ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper



use of_sdw_find_device_by_node helper function, rather than duplicating
this function in every codec driver.

Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20250909121954.225833-6-srinivas.kandagatla@oss.qualcomm.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e07017b
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -78,12 +78,6 @@ static struct sdw_dpn_prop wcd937x_dpn_prop[WCD937X_MAX_SWR_PORTS] = {
	}
};

struct device *wcd937x_sdw_device_get(struct device_node *np)
{
	return bus_find_device_by_of_node(&sdw_bus_type, np);
}
EXPORT_SYMBOL_GPL(wcd937x_sdw_device_get);

int wcd937x_sdw_hw_params(struct wcd937x_sdw_priv *wcd,
			  struct snd_pcm_substream *substream,
			  struct snd_pcm_hw_params *params,
+2 −2
Original line number Diff line number Diff line
@@ -2788,7 +2788,7 @@ static int wcd937x_bind(struct device *dev)
		return ret;
	}

	wcd937x->rxdev = wcd937x_sdw_device_get(wcd937x->rxnode);
	wcd937x->rxdev = of_sdw_find_device_by_node(wcd937x->rxnode);
	if (!wcd937x->rxdev) {
		dev_err(dev, "could not find slave with matching of node\n");
		return -EINVAL;
@@ -2797,7 +2797,7 @@ static int wcd937x_bind(struct device *dev)
	wcd937x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd937x->rxdev);
	wcd937x->sdw_priv[AIF1_PB]->wcd937x = wcd937x;

	wcd937x->txdev = wcd937x_sdw_device_get(wcd937x->txnode);
	wcd937x->txdev = of_sdw_find_device_by_node(wcd937x->txnode);
	if (!wcd937x->txdev) {
		dev_err(dev, "could not find txslave with matching of node\n");
		return -EINVAL;
+0 −2
Original line number Diff line number Diff line
@@ -549,8 +549,6 @@ int wcd937x_sdw_hw_params(struct wcd937x_sdw_priv *wcd,
			  struct snd_pcm_hw_params *params,
			  struct snd_soc_dai *dai);

struct device *wcd937x_sdw_device_get(struct device_node *np);

#else
static inline int wcd937x_sdw_free(struct wcd937x_sdw_priv *wcd,
		     struct snd_pcm_substream *substream,
+0 −7
Original line number Diff line number Diff line
@@ -82,13 +82,6 @@ static struct sdw_dpn_prop wcd938x_dpn_prop[WCD938X_MAX_SWR_PORTS] = {
	}
};

struct device *wcd938x_sdw_device_get(struct device_node *np)
{
	return bus_find_device_by_of_node(&sdw_bus_type, np);

}
EXPORT_SYMBOL_GPL(wcd938x_sdw_device_get);

int wcd938x_swr_get_current_bank(struct sdw_slave *sdev)
{
	int bank;
+2 −2
Original line number Diff line number Diff line
@@ -3400,7 +3400,7 @@ static int wcd938x_bind(struct device *dev)
		return ret;
	}

	wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode);
	wcd938x->rxdev = of_sdw_find_device_by_node(wcd938x->rxnode);
	if (!wcd938x->rxdev) {
		dev_err(dev, "could not find slave with matching of node\n");
		ret = -EINVAL;
@@ -3409,7 +3409,7 @@ static int wcd938x_bind(struct device *dev)
	wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev);
	wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x;

	wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode);
	wcd938x->txdev = of_sdw_find_device_by_node(wcd938x->txnode);
	if (!wcd938x->txdev) {
		dev_err(dev, "could not find txslave with matching of node\n");
		ret = -EINVAL;
Loading