Commit 2ea6b074 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: rsnd: remove struct platform_device from probe/remove parameter



Current Renesas sound driver requests struct platform_device on
probe/remove for each modules. But driver can get it by
rsnd_priv_to_pdev(). This patch removes unnecessary parameter

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea2cc86
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -515,8 +515,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
		ckr, rbga, rbgb);
}

int rsnd_adg_probe(struct platform_device *pdev,
		   struct rsnd_priv *priv)
int rsnd_adg_probe(struct rsnd_priv *priv)
{
	struct rsnd_adg *adg;
	struct device *dev = rsnd_priv_to_dev(priv);
@@ -543,8 +542,7 @@ int rsnd_adg_probe(struct platform_device *pdev,
	return 0;
}

void rsnd_adg_remove(struct platform_device *pdev,
		     struct rsnd_priv *priv)
void rsnd_adg_remove(struct rsnd_priv *priv)
{
	struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
	struct clk *clk;
+2 −4
Original line number Diff line number Diff line
@@ -127,8 +127,7 @@ struct rsnd_mod *rsnd_cmd_mod_get(struct rsnd_priv *priv, int id)
	return rsnd_mod_get((struct rsnd_cmd *)(priv->cmd) + id);
}

int rsnd_cmd_probe(struct platform_device *pdev,
		   struct rsnd_priv *priv)
int rsnd_cmd_probe(struct rsnd_priv *priv)
{
	struct device *dev = rsnd_priv_to_dev(priv);
	struct rsnd_cmd *cmd;
@@ -160,8 +159,7 @@ int rsnd_cmd_probe(struct platform_device *pdev,
	return 0;
}

void rsnd_cmd_remove(struct platform_device *pdev,
		     struct rsnd_priv *priv)
void rsnd_cmd_remove(struct rsnd_priv *priv)
{
	struct rsnd_cmd *cmd;
	int i;
+6 −9
Original line number Diff line number Diff line
@@ -546,8 +546,7 @@ static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
	.set_fmt	= rsnd_soc_dai_set_fmt,
};

static int rsnd_dai_probe(struct platform_device *pdev,
			  struct rsnd_priv *priv)
static int rsnd_dai_probe(struct rsnd_priv *priv)
{
	struct device_node *dai_node;
	struct device_node *dai_np, *np, *node;
@@ -556,7 +555,7 @@ static int rsnd_dai_probe(struct platform_device *pdev,
	struct rsnd_dai_stream *io_capture;
	struct snd_soc_dai_driver *drv;
	struct rsnd_dai *rdai;
	struct device *dev = &pdev->dev;
	struct device *dev = rsnd_priv_to_dev(priv);
	int nr, dai_i, io_i, np_i;
	int ret;

@@ -975,8 +974,7 @@ static int rsnd_probe(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	struct rsnd_dai *rdai;
	const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
	int (*probe_func[])(struct platform_device *pdev,
			    struct rsnd_priv *priv) = {
	int (*probe_func[])(struct rsnd_priv *priv) = {
		rsnd_gen_probe,
		rsnd_dma_probe,
		rsnd_ssi_probe,
@@ -1008,7 +1006,7 @@ static int rsnd_probe(struct platform_device *pdev)
	 *	init each module
	 */
	for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
		ret = probe_func[i](pdev, priv);
		ret = probe_func[i](priv);
		if (ret)
			return ret;
	}
@@ -1061,8 +1059,7 @@ static int rsnd_remove(struct platform_device *pdev)
{
	struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
	struct rsnd_dai *rdai;
	void (*remove_func[])(struct platform_device *pdev,
			      struct rsnd_priv *priv) = {
	void (*remove_func[])(struct rsnd_priv *priv) = {
		rsnd_ssi_remove,
		rsnd_ssiu_remove,
		rsnd_src_remove,
@@ -1082,7 +1079,7 @@ static int rsnd_remove(struct platform_device *pdev)
	}

	for (i = 0; i < ARRAY_SIZE(remove_func); i++)
		remove_func[i](pdev, priv);
		remove_func[i](priv);

	snd_soc_unregister_component(&pdev->dev);
	snd_soc_unregister_platform(&pdev->dev);
+2 −4
Original line number Diff line number Diff line
@@ -77,8 +77,7 @@ struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id)
	return rsnd_mod_get(rsnd_ctu_get(priv, id));
}

int rsnd_ctu_probe(struct platform_device *pdev,
		   struct rsnd_priv *priv)
int rsnd_ctu_probe(struct rsnd_priv *priv)
{
	struct device_node *node;
	struct device_node *np;
@@ -143,8 +142,7 @@ rsnd_ctu_probe_done:
	return ret;
}

void rsnd_ctu_remove(struct platform_device *pdev,
		     struct rsnd_priv *priv)
void rsnd_ctu_remove(struct rsnd_priv *priv)
{
	struct rsnd_ctu *ctu;
	int i;
+2 −2
Original line number Diff line number Diff line
@@ -701,9 +701,9 @@ struct rsnd_mod *rsnd_dma_attach(struct rsnd_dai_stream *io,
	return rsnd_mod_get(dma);
}

int rsnd_dma_probe(struct platform_device *pdev,
		   struct rsnd_priv *priv)
int rsnd_dma_probe(struct rsnd_priv *priv)
{
	struct platform_device *pdev = rsnd_priv_to_pdev(priv);
	struct device *dev = rsnd_priv_to_dev(priv);
	struct rsnd_dma_ctrl *dmac;
	struct resource *res;
Loading