Skip to contentSkip to conversation

ASoC: ti: Use of_device_get_match_data

PATCH In review Aakash Hemadri 2 participants 8 messages Aug 14, 2021 – Aug 16, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ASoC: ti: Use of_device_get_match_data

Hi,
This patch series will apply cleanly on for-next
Prefer of_device_get_match_data over of_match_device.

Aakash Hemadri (3):
ASoC: ti: davinci-mcasp: Use of_device_get_match_data
ASoC: ti: omap-mcbsp: Use of_device_get_match_data
ASoC: ti: davinci-evm: Use of_device_get_match_data

 sound/soc/ti/davinci-evm.c   | 2 +-
 sound/soc/ti/davinci-mcasp.c | 2 +-
 sound/soc/ti/omap-mcbsp.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/3 ASoC: ti: davinci-mcasp: Use of_device_get_match_data

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/davinci-mcasp.c +1 -1
index 56a19eeec5c7..b26e8d324078 100644
@@ -1881,7 +1881,7 @@ static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
 static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
 				    struct platform_device *pdev)
 {
-	const struct of_device_id *match = of_match_device(mcasp_dt_ids, &pdev->dev);
+	const struct of_device_id *match = of_device_get_match_data(&pdev->dev);
 	struct device_node *np = pdev->dev.of_node;
 	struct davinci_mcasp_pdata *pdata = NULL;
 	const u32 *of_serial_dir32;
Signature · 1 line
2.32.0
#2 lore raw

Re: [PATCH 1/3] ASoC: ti: davinci-mcasp: Use of_device_get_match_data

Quoted 15 lines · Aakash Hemadri

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/davinci-mcasp.c +0 -0
index 56a19eeec5c7..b26e8d324078 100644

sound/soc/ti/davinci-mcasp.c static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp) · line 1884

Quoted 5 lines
sound/soc/ti/davinci-mcasp.c +1 -1
@@ -1881,7 +1881,7 @@ static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
 static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
 				    struct platform_device *pdev)
 {
-	const struct of_device_id *match = of_match_device(mcasp_dt_ids, &pdev->dev);
+	const struct of_device_id *match = of_device_get_match_data(&pdev->dev);

No.
of_device_get_match_data() returns the match->data

Quoted 4 lines
sound/soc/ti/davinci-mcasp.c +0 -0
 	struct device_node *np = pdev->dev.of_node;
 	struct davinci_mcasp_pdata *pdata = NULL;
 	const u32 *of_serial_dir32;
Signature · 1 line
Péter
#3 lore raw

PATCH 2/3 ASoC: ti: omap-mcbsp: Use of_device_get_match_data

In reply to Aakash Hemadri

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/omap-mcbsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/omap-mcbsp.c +1 -1
index 4479d74f0a45..fcb651487854 100644
@@ -1373,7 +1373,7 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	int ret;
 
-	match = of_match_device(omap_mcbsp_of_match, &pdev->dev);
+	match = of_device_get_match_data(&pdev->dev);
 	if (match) {
 		struct device_node *node = pdev->dev.of_node;
 		struct omap_mcbsp_platform_data *pdata_quirk = pdata;
Signature · 1 line
2.32.0
#4 lore raw

Re: [PATCH 2/3] ASoC: ti: omap-mcbsp: Use of_device_get_match_data

Quoted 15 lines · Aakash Hemadri

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/omap-mcbsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/omap-mcbsp.c +0 -0
index 4479d74f0a45..fcb651487854 100644

sound/soc/ti/omap-mcbsp.c static int asoc_mcbsp_probe(struct platform_device *pdev) · line 1376

Quoted 5 lines
sound/soc/ti/omap-mcbsp.c +1 -1
@@ -1373,7 +1373,7 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	int ret;
 
-	match = of_match_device(omap_mcbsp_of_match, &pdev->dev);
+	match = of_device_get_match_data(&pdev->dev);

Similarly incorrect,
of_device_get_match_data() is retrieving the match->data

Quoted 4 lines
sound/soc/ti/omap-mcbsp.c +0 -0
 	if (match) {
 		struct device_node *node = pdev->dev.of_node;
 		struct omap_mcbsp_platform_data *pdata_quirk = pdata;
Signature · 1 line
Péter
#5 lore raw

PATCH 3/3 ASoC: ti: davinci-evm: Use of_device_get_match_data

In reply to Aakash Hemadri

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/davinci-evm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/davinci-evm.c +1 -1
index b043a0070d20..bf13f3d25cec 100644
@@ -389,7 +389,7 @@ static int davinci_evm_probe(struct platform_device *pdev)
 	struct clk *mclk;
 	int ret = 0;
 
-	match = of_match_device(of_match_ptr(davinci_evm_dt_ids), &pdev->dev);
+	match = of_device_get_match_data(&pdev->dev);
 	if (!match) {
 		dev_err(&pdev->dev, "Error: No device match found\n");
 		return -ENODEV;
Signature · 1 line
2.32.0
#6 lore raw

Re: [PATCH 3/3] ASoC: ti: davinci-evm: Use of_device_get_match_data

Quoted 15 lines · Aakash Hemadri

Prefer of_device_get_match_data over of_match_device

Retrieve OF match data using of_device_get_match_data, this is cleaner and better expresses intent.

---
 sound/soc/ti/davinci-evm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/ti/davinci-evm.c +0 -0
index b043a0070d20..bf13f3d25cec 100644

sound/soc/ti/davinci-evm.c static int davinci_evm_probe(struct platform_device *pdev) · line 392

Quoted 5 lines
sound/soc/ti/davinci-evm.c +1 -1
@@ -389,7 +389,7 @@ static int davinci_evm_probe(struct platform_device *pdev)
 	struct clk *mclk;
 	int ret = 0;
 
-	match = of_match_device(of_match_ptr(davinci_evm_dt_ids), &pdev->dev);
+	match = of_device_get_match_data(&pdev->dev);

incorrect,
of_device_get_match_data() is retrieving the match->data

Quoted 4 lines
sound/soc/ti/davinci-evm.c +0 -0
 	if (!match) {
 		dev_err(&pdev->dev, "Error: No device match found\n");
 		return -ENODEV;
Signature · 1 line
Péter
#7 lore raw
In reply to Aakash Hemadri

Hi,

Quoted 3 lines · Aakash Hemadri

Hi,
This patch series will apply cleanly on for-next
Prefer of_device_get_match_data over of_match_device.

All three patch is wrong.
Mark, please do not pick them up.

Quoted 10 lines

Aakash Hemadri (3):
ASoC: ti: davinci-mcasp: Use of_device_get_match_data
ASoC: ti: omap-mcbsp: Use of_device_get_match_data
ASoC: ti: davinci-evm: Use of_device_get_match_data

 sound/soc/ti/davinci-evm.c   | 2 +-
 sound/soc/ti/davinci-mcasp.c | 2 +-
 sound/soc/ti/omap-mcbsp.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
Péter