Skip to contentSkip to conversation

ASoC: mxs-saif: Remove platform data

PATCH Superseded Fabio Estevam 4 participants 5 messages Oct 31, 2012 – Nov 1, 2012

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v3 1/2 ASoC: mxs-saif: Remove platform data

From: Fabio Estevam <[email protected]>

All MXS users have been converted to device tree and the board files have been removed.

No need to keep platform data in the driver.

---
Changes since v2:
- Also remove 'if (np)' as dt is the only probing mechanism. Changes since v1:
- Also remove mxs_saif_platform_data and sound/saif.h, which was used only to include mxs_saif_platform_data definition.

 include/sound/saif.h     |   16 ----------------
 sound/soc/mxs/mxs-saif.c |   42 +++++++++++++++---------------------------
 2 files changed, 15 insertions(+), 43 deletions(-)
 delete mode 100644 include/sound/saif.h
include/sound/saif.h deleted +0 -0
deleted file mode 100644
index f22f3e1..0000000
sound/soc/mxs/mxs-saif.c +15 -27

63 lines not on this page · raw message

Signature · 1 line
1.7.9.5
Acked-by on v3 1/2
#1 lore raw
Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

All MXS users have been converted to device tree and the board files have been removed.

No need to keep platform data in the driver.

Quoted 87 lines

---
Changes since v2:
- Also remove 'if (np)' as dt is the only probing mechanism. Changes since v1:
- Also remove mxs_saif_platform_data and sound/saif.h, which was used only to include mxs_saif_platform_data definition.

 include/sound/saif.h     |   16 ----------------
 sound/soc/mxs/mxs-saif.c |   42 +++++++++++++++---------------------------
 2 files changed, 15 insertions(+), 43 deletions(-)
 delete mode 100644 include/sound/saif.h
include/sound/saif.h deleted +0 -0
deleted file mode 100644
index f22f3e1..0000000
sound/soc/mxs/mxs-saif.c +15 -27
index aa037b2..ab5bdec 100644
@@ -32,7 +32,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
-#include <sound/saif.h>
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <mach/mxs.h>
@@ -652,10 +651,9 @@ static int __devinit mxs_saif_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct resource *iores, *dmares;
 	struct mxs_saif *saif;
-	struct mxs_saif_platform_data *pdata;
 	struct pinctrl *pinctrl;
 	int ret = 0;
-
+	struct device_node *master;
 
 	if (!np && pdev->id >= ARRAY_SIZE(mxs_saif))
 		return -EINVAL;
@@ -664,31 +662,21 @@ static int __devinit mxs_saif_probe(struct platform_device *pdev)
 	if (!saif)
 		return -ENOMEM;
 
-	if (np) {
-		struct device_node *master;
-		saif->id = of_alias_get_id(np, "saif");
-		if (saif->id < 0)
-			return saif->id;
-		/*
-		 * If there is no "fsl,saif-master" phandle, it's a saif
-		 * master.  Otherwise, it's a slave and its phandle points
-		 * to the master.
-		 */
-		master = of_parse_phandle(np, "fsl,saif-master", 0);
-		if (!master) {
-			saif->master_id = saif->id;
-		} else {
-			saif->master_id = of_alias_get_id(master, "saif");
-			if (saif->master_id < 0)
-				return saif->master_id;
-		}
+	saif->id = of_alias_get_id(np, "saif");
+	if (saif->id < 0)
+		return saif->id;
+	/*
+	 * If there is no "fsl,saif-master" phandle, it's a saif
+	 * master.  Otherwise, it's a slave and its phandle points
+	 * to the master.
+	 */
+	master = of_parse_phandle(np, "fsl,saif-master", 0);
+	if (!master) {
+		saif->master_id = saif->id;
 	} else {
-		saif->id = pdev->id;
-		pdata = pdev->dev.platform_data;
-		if (pdata && !pdata->master_mode)
-			saif->master_id = pdata->master_id;
-		else
-			saif->master_id = saif->id;
+		saif->master_id = of_alias_get_id(master, "saif");
+		if (saif->master_id < 0)
+			return saif->master_id;
 	}
 
 	if (saif->master_id < 0 || saif->master_id >= ARRAY_SIZE(mxs_saif)) {
Signature · 1 line
1.7.9.5
Acked-by on v3 1/2
#2 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

All MXS users have been converted to device tree and the board files have been removed.

No need to keep platform data in the driver.

Only one minor comment, otherwise,

Quoted 27 lines

---
Changes since v2:
- Also remove 'if (np)' as dt is the only probing mechanism. Changes since v1:
- Also remove mxs_saif_platform_data and sound/saif.h, which was used only to include mxs_saif_platform_data definition.

 include/sound/saif.h     |   16 ----------------
 sound/soc/mxs/mxs-saif.c |   42 +++++++++++++++---------------------------
 2 files changed, 15 insertions(+), 43 deletions(-)
 delete mode 100644 include/sound/saif.h
include/sound/saif.h deleted +0 -0
deleted file mode 100644
index f22f3e1..0000000
sound/soc/mxs/mxs-saif.c +0 -1
index aa037b2..ab5bdec 100644
@@ -32,7 +32,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
-#include <sound/saif.h>
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <mach/mxs.h>

sound/soc/mxs/mxs-saif.c static int __devinit mxs_saif_probe(struct platform_device *pdev) · line 658

Quoted 10 lines
sound/soc/mxs/mxs-saif.c +1 -2
@@ -652,10 +651,9 @@ static int __devinit mxs_saif_probe(struct platform_device *pdev)
        struct device_node *np = pdev->dev.of_node;
        struct resource *iores, *dmares;
        struct mxs_saif *saif;
-       struct mxs_saif_platform_data *pdata;
        struct pinctrl *pinctrl;
        int ret = 0;
-
+       struct device_node *master;
 
        if (!np && pdev->id >= ARRAY_SIZE(mxs_saif))

Can we also clean up this line?
It seems pdev->id checking is also needless after converting to dt only.

sound/soc/mxs/mxs-saif.c static int __devinit mxs_saif_probe(struct platform_device *pdev) · line 659

Quoted 1 line
sound/soc/mxs/mxs-saif.c +0 -0
                return -EINVAL;

Regards
Dong Aisheng

#3 lore raw
In reply to Fabio Estevam
Quoted 4 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

All MXS users have been converted to device tree and the board files have been removed.

This doesn't apply against v3.7-rc3 so I wasn't able to make a topic branch for it. Can you check what's going on here please?