2020-11-20 16:19:51

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/codecs/ak5558.c:418:34: warning: ‘ak5558_i2c_dt_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/ak5558.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c
index 2f076d5ee284..427d7d51bf53 100644
--- a/sound/soc/codecs/ak5558.c
+++ b/sound/soc/codecs/ak5558.c
@@ -423,7 +423,7 @@ static const struct of_device_id ak5558_i2c_dt_ids[] = {
static struct i2c_driver ak5558_i2c_driver = {
.driver = {
.name = "ak5558",
- .of_match_table = of_match_ptr(ak5558_i2c_dt_ids),
+ .of_match_table = ak5558_i2c_dt_ids,
.pm = &ak5558_pm,
},
.probe_new = ak5558_i2c_probe,
--
2.25.1


2020-11-20 16:19:55

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 02/38] ASoC: gtm601: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/codecs/gtm601.c:90:34: warning: ‘gtm601_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/gtm601.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c
index ae9e1c70ca57..5dfd26e1fe9a 100644
--- a/sound/soc/codecs/gtm601.c
+++ b/sound/soc/codecs/gtm601.c
@@ -97,7 +97,7 @@ MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
static struct platform_driver gtm601_codec_driver = {
.driver = {
.name = "gtm601",
- .of_match_table = of_match_ptr(gtm601_codec_of_match),
+ .of_match_table = gtm601_codec_of_match,
},
.probe = gtm601_platform_probe,
};
--
2.25.1

2020-11-20 16:20:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 03/38] ASoC: inno_rk3036: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/codecs/inno_rk3036.c:470:34: warning: ‘rk3036_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/inno_rk3036.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/inno_rk3036.c b/sound/soc/codecs/inno_rk3036.c
index d0e8f0d2fbc1..af74251e08b0 100644
--- a/sound/soc/codecs/inno_rk3036.c
+++ b/sound/soc/codecs/inno_rk3036.c
@@ -476,7 +476,7 @@ MODULE_DEVICE_TABLE(of, rk3036_codec_of_match);
static struct platform_driver rk3036_codec_platform_driver = {
.driver = {
.name = "rk3036-codec-platform",
- .of_match_table = of_match_ptr(rk3036_codec_of_match),
+ .of_match_table = rk3036_codec_of_match,
},
.probe = rk3036_codec_platform_probe,
.remove = rk3036_codec_platform_remove,
--
2.25.1

2020-11-20 16:20:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 04/38] ASoC: rk3328: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/codecs/rk3328_codec.c:502:34: warning: ‘rk3328_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/rk3328_codec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rk3328_codec.c b/sound/soc/codecs/rk3328_codec.c
index 940a2fa933ed..d955525b0354 100644
--- a/sound/soc/codecs/rk3328_codec.c
+++ b/sound/soc/codecs/rk3328_codec.c
@@ -508,7 +508,7 @@ MODULE_DEVICE_TABLE(of, rk3328_codec_of_match);
static struct platform_driver rk3328_codec_driver = {
.driver = {
.name = "rk3328-codec",
- .of_match_table = of_match_ptr(rk3328_codec_of_match),
+ .of_match_table = rk3328_codec_of_match,
},
.probe = rk3328_platform_probe,
};
--
2.25.1

2020-11-20 16:20:24

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 06/38] ASoC: kirkwood: armada-370-db: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/kirkwood/armada-370-db.c:137:34: warning: ‘a370db_dt_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/kirkwood/armada-370-db.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/kirkwood/armada-370-db.c b/sound/soc/kirkwood/armada-370-db.c
index 8e44ae37ad1e..b12141ad15cb 100644
--- a/sound/soc/kirkwood/armada-370-db.c
+++ b/sound/soc/kirkwood/armada-370-db.c
@@ -143,7 +143,7 @@ MODULE_DEVICE_TABLE(of, a370db_dt_ids);
static struct platform_driver a370db_driver = {
.driver = {
.name = "a370db-audio",
- .of_match_table = of_match_ptr(a370db_dt_ids),
+ .of_match_table = a370db_dt_ids,
},
.probe = a370db_probe,
};
--
2.25.1

2020-11-20 16:20:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 09/38] ASoC: samsung: smdk_wm8994: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/samsung/smdk_wm8994.c:139:34: warning: ‘samsung_wm8994_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/samsung/smdk_wm8994.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 64a1a64656ab..696ab6abd1f6 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -187,7 +187,7 @@ static int smdk_audio_probe(struct platform_device *pdev)
static struct platform_driver smdk_audio_driver = {
.driver = {
.name = "smdk-audio-wm8994",
- .of_match_table = of_match_ptr(samsung_wm8994_of_match),
+ .of_match_table = samsung_wm8994_of_match,
.pm = &snd_soc_pm_ops,
},
.probe = smdk_audio_probe,
--
2.25.1

2020-11-20 16:20:46

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 11/38] ASoC: ti: davinci: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/ti/davinci-i2s.c:750:34: warning: ‘davinci_i2s_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/ti/davinci-i2s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
index dd34504c09ba..0039b689745a 100644
--- a/sound/soc/ti/davinci-i2s.c
+++ b/sound/soc/ti/davinci-i2s.c
@@ -758,7 +758,7 @@ static struct platform_driver davinci_mcbsp_driver = {
.remove = davinci_i2s_remove,
.driver = {
.name = "davinci-mcbsp",
- .of_match_table = of_match_ptr(davinci_i2s_match),
+ .of_match_table = davinci_i2s_match,
},
};

--
2.25.1

2020-11-20 16:21:14

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 05/38] ASoC: tas571x: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/codecs/tas571x.c:892:34: warning: ‘tas571x_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/tas571x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c
index 835a723ce5bc..1a87697eea16 100644
--- a/sound/soc/codecs/tas571x.c
+++ b/sound/soc/codecs/tas571x.c
@@ -912,7 +912,7 @@ MODULE_DEVICE_TABLE(i2c, tas571x_i2c_id);
static struct i2c_driver tas571x_i2c_driver = {
.driver = {
.name = "tas571x",
- .of_match_table = of_match_ptr(tas571x_of_match),
+ .of_match_table = tas571x_of_match,
},
.probe = tas571x_i2c_probe,
.remove = tas571x_i2c_remove,
--
2.25.1

2020-11-20 16:21:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 07/38] ASoC: meson: t9015: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/meson/t9015.c:315:34: warning: ‘t9015_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/meson/t9015.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
index 56d2592c16d5..0532a2b8c240 100644
--- a/sound/soc/meson/t9015.c
+++ b/sound/soc/meson/t9015.c
@@ -321,7 +321,7 @@ MODULE_DEVICE_TABLE(of, t9015_ids);
static struct platform_driver t9015_driver = {
.driver = {
.name = "t9015-codec",
- .of_match_table = of_match_ptr(t9015_ids),
+ .of_match_table = t9015_ids,
},
.probe = t9015_probe,
};
--
2.25.1

2020-11-20 16:21:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 08/38] ASoC: qcom: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/qcom/lpass-apq8016.c:294:34: warning: ‘apq8016_lpass_cpu_device_id’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/qcom/apq8016_sbc.c | 2 +-
sound/soc/qcom/lpass-apq8016.c | 2 +-
sound/soc/qcom/lpass-ipq806x.c | 2 +-
sound/soc/qcom/lpass-sc7180.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index 575e2aefefe3..cc8c3f929683 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -176,7 +176,7 @@ MODULE_DEVICE_TABLE(of, apq8016_sbc_device_id);
static struct platform_driver apq8016_sbc_platform_driver = {
.driver = {
.name = "qcom-apq8016-sbc",
- .of_match_table = of_match_ptr(apq8016_sbc_device_id),
+ .of_match_table = apq8016_sbc_device_id,
},
.probe = apq8016_sbc_platform_probe,
};
diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index 0aedb3a0a798..4ee1de6588bb 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -300,7 +300,7 @@ MODULE_DEVICE_TABLE(of, apq8016_lpass_cpu_device_id);
static struct platform_driver apq8016_lpass_cpu_platform_driver = {
.driver = {
.name = "apq8016-lpass-cpu",
- .of_match_table = of_match_ptr(apq8016_lpass_cpu_device_id),
+ .of_match_table = apq8016_lpass_cpu_device_id,
},
.probe = asoc_qcom_lpass_cpu_platform_probe,
.remove = asoc_qcom_lpass_cpu_platform_remove,
diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c
index 832a9161484e..421d65a546f3 100644
--- a/sound/soc/qcom/lpass-ipq806x.c
+++ b/sound/soc/qcom/lpass-ipq806x.c
@@ -170,7 +170,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_lpass_cpu_device_id);
static struct platform_driver ipq806x_lpass_cpu_platform_driver = {
.driver = {
.name = "lpass-cpu",
- .of_match_table = of_match_ptr(ipq806x_lpass_cpu_device_id),
+ .of_match_table = ipq806x_lpass_cpu_device_id,
},
.probe = asoc_qcom_lpass_cpu_platform_probe,
.remove = asoc_qcom_lpass_cpu_platform_remove,
diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c
index bc998d501600..3f4efd050a29 100644
--- a/sound/soc/qcom/lpass-sc7180.c
+++ b/sound/soc/qcom/lpass-sc7180.c
@@ -293,7 +293,7 @@ MODULE_DEVICE_TABLE(of, sc7180_lpass_cpu_device_id);
static struct platform_driver sc7180_lpass_cpu_platform_driver = {
.driver = {
.name = "sc7180-lpass-cpu",
- .of_match_table = of_match_ptr(sc7180_lpass_cpu_device_id),
+ .of_match_table = sc7180_lpass_cpu_device_id,
},
.probe = asoc_qcom_lpass_cpu_platform_probe,
.remove = asoc_qcom_lpass_cpu_platform_remove,
--
2.25.1

2020-11-20 16:21:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 24/38] ASoC: max98925: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max98925.c:630:34: warning: ‘max98925_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98925.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c
index b3e1a54fff88..e18d0022c3f4 100644
--- a/sound/soc/codecs/max98925.c
+++ b/sound/soc/codecs/max98925.c
@@ -627,11 +627,13 @@ static const struct i2c_device_id max98925_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98925_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max98925_of_match[] = {
{ .compatible = "maxim,max98925", },
{ }
};
MODULE_DEVICE_TABLE(of, max98925_of_match);
+#endif

static struct i2c_driver max98925_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:21:54

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 25/38] ASoC: max98926: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max98926.c:574:34: warning: ‘max98926_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98926.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98926.c b/sound/soc/codecs/max98926.c
index c4dfa8ab1d49..0977e541326d 100644
--- a/sound/soc/codecs/max98926.c
+++ b/sound/soc/codecs/max98926.c
@@ -571,11 +571,13 @@ static const struct i2c_device_id max98926_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98926_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max98926_of_match[] = {
{ .compatible = "maxim,max98926", },
{ }
};
MODULE_DEVICE_TABLE(of, max98926_of_match);
+#endif

static struct i2c_driver max98926_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:21:59

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 27/38] ASoC: pcm179x: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/pcm179x-i2c.c:33:34: warning: ‘pcm179x_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/pcm179x-i2c.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/pcm179x-i2c.c b/sound/soc/codecs/pcm179x-i2c.c
index 36e01678bef4..34a3d596f288 100644
--- a/sound/soc/codecs/pcm179x-i2c.c
+++ b/sound/soc/codecs/pcm179x-i2c.c
@@ -30,11 +30,13 @@ static int pcm179x_i2c_probe(struct i2c_client *client,
return pcm179x_common_init(&client->dev, regmap);
}

+#ifdef CONFIG_OF
static const struct of_device_id pcm179x_of_match[] = {
{ .compatible = "ti,pcm1792a", },
{ }
};
MODULE_DEVICE_TABLE(of, pcm179x_of_match);
+#endif

static const struct i2c_device_id pcm179x_i2c_ids[] = {
{ "pcm179x", 0 },
--
2.25.1

2020-11-20 16:21:59

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 12/38] ASoC: uniphier: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/uniphier/aio-ld11.c:375:34: warning: ‘uniphier_aio_of_match’ defined but not used [-Wunused-const-variable=]
sound/soc/uniphier/evea.c:554:34: warning: ‘evea_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/uniphier/aio-ld11.c | 2 +-
sound/soc/uniphier/aio-pxs2.c | 2 +-
sound/soc/uniphier/evea.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/uniphier/aio-ld11.c b/sound/soc/uniphier/aio-ld11.c
index 8b44f8dc4970..107dd8c15a0a 100644
--- a/sound/soc/uniphier/aio-ld11.c
+++ b/sound/soc/uniphier/aio-ld11.c
@@ -388,7 +388,7 @@ MODULE_DEVICE_TABLE(of, uniphier_aio_of_match);
static struct platform_driver uniphier_aio_driver = {
.driver = {
.name = "snd-uniphier-aio-ld11",
- .of_match_table = of_match_ptr(uniphier_aio_of_match),
+ .of_match_table = uniphier_aio_of_match,
},
.probe = uniphier_aio_probe,
.remove = uniphier_aio_remove,
diff --git a/sound/soc/uniphier/aio-pxs2.c b/sound/soc/uniphier/aio-pxs2.c
index a1d05fe9d3c2..66e983d80c5e 100644
--- a/sound/soc/uniphier/aio-pxs2.c
+++ b/sound/soc/uniphier/aio-pxs2.c
@@ -294,7 +294,7 @@ MODULE_DEVICE_TABLE(of, uniphier_aio_of_match);
static struct platform_driver uniphier_aio_driver = {
.driver = {
.name = "snd-uniphier-aio-pxs2",
- .of_match_table = of_match_ptr(uniphier_aio_of_match),
+ .of_match_table = uniphier_aio_of_match,
},
.probe = uniphier_aio_probe,
.remove = uniphier_aio_remove,
diff --git a/sound/soc/uniphier/evea.c b/sound/soc/uniphier/evea.c
index d27e9ca07856..b14d52052439 100644
--- a/sound/soc/uniphier/evea.c
+++ b/sound/soc/uniphier/evea.c
@@ -560,7 +560,7 @@ MODULE_DEVICE_TABLE(of, evea_of_match);
static struct platform_driver evea_codec_driver = {
.driver = {
.name = DRV_NAME,
- .of_match_table = of_match_ptr(evea_of_match),
+ .of_match_table = evea_of_match,
},
.probe = evea_probe,
.remove = evea_remove,
--
2.25.1

2020-11-20 16:22:07

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 28/38] ASoC: rt5660: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/rt5660.c:1238:34: warning: ‘rt5660_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/rt5660.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c
index 9e3813f7583d..0edf09d3a499 100644
--- a/sound/soc/codecs/rt5660.c
+++ b/sound/soc/codecs/rt5660.c
@@ -1235,11 +1235,13 @@ static const struct i2c_device_id rt5660_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, rt5660_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id rt5660_of_match[] = {
{ .compatible = "realtek,rt5660", },
{},
};
MODULE_DEVICE_TABLE(of, rt5660_of_match);
+#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id rt5660_acpi_match[] = {
--
2.25.1

2020-11-20 16:22:09

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 14/38] ASoC: alc5623: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/alc5623.c:1071:34: warning: ‘alc5623_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/alc5623.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index 3d1761a531f5..54f489837162 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -1068,11 +1068,13 @@ static const struct i2c_device_id alc5623_i2c_table[] = {
};
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);

+#ifdef CONFIG_OF
static const struct of_device_id alc5623_of_match[] = {
{ .compatible = "realtek,alc5623", },
{ }
};
MODULE_DEVICE_TABLE(of, alc5623_of_match);
+#endif

/* i2c codec control layer */
static struct i2c_driver alc5623_i2c_driver = {
--
2.25.1

2020-11-20 16:22:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 15/38] ASoC: alc5632: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/alc5632.c:1170:34: warning: ‘alc5632_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/alc5632.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index 9d6dcd3ffa57..bde5ded67754 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1167,11 +1167,13 @@ static const struct i2c_device_id alc5632_i2c_table[] = {
};
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);

+#ifdef CONFIG_OF
static const struct of_device_id alc5632_of_match[] = {
{ .compatible = "realtek,alc5632", },
{ }
};
MODULE_DEVICE_TABLE(of, alc5632_of_match);
+#endif

/* i2c codec control layer */
static struct i2c_driver alc5632_i2c_driver = {
--
2.25.1

2020-11-20 16:22:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 20/38] ASoC: max98090: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max98090.c:2671:34: warning: ‘max98090_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98090.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 945a79e4f3eb..06276ff5f8a3 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2668,12 +2668,14 @@ static const struct i2c_device_id max98090_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98090_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max98090_of_match[] = {
{ .compatible = "maxim,max98090", },
{ .compatible = "maxim,max98091", },
{ }
};
MODULE_DEVICE_TABLE(of, max98090_of_match);
+#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id max98090_acpi_match[] = {
--
2.25.1

2020-11-20 16:22:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 19/38] ASoC: es8316: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/es8316.c:837:34: warning: ‘es8316_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/es8316.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index bd5d230c5df2..f9ec5cf82599 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -834,11 +834,13 @@ static const struct i2c_device_id es8316_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, es8316_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id es8316_of_match[] = {
{ .compatible = "everest,es8316", },
{},
};
MODULE_DEVICE_TABLE(of, es8316_of_match);
+#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id es8316_acpi_match[] = {
--
2.25.1

2020-11-20 16:22:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 18/38] ASoC: da9055: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/da9055.c:1522:34: warning: ‘da9055_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/da9055.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c
index b0d9ca6de685..aed92f615b02 100644
--- a/sound/soc/codecs/da9055.c
+++ b/sound/soc/codecs/da9055.c
@@ -1519,11 +1519,13 @@ static const struct i2c_device_id da9055_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id da9055_of_match[] = {
{ .compatible = "dlg,da9055-codec", },
{ }
};
MODULE_DEVICE_TABLE(of, da9055_of_match);
+#endif

/* I2C codec control layer */
static struct i2c_driver da9055_i2c_driver = {
--
2.25.1

2020-11-20 16:22:44

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 21/38] ASoC: max98095: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max98095.c:2151:34: warning: ‘max98095_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98095.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 9bdc6392382a..736cd70be725 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -2148,11 +2148,13 @@ static const struct i2c_device_id max98095_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98095_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max98095_of_match[] = {
{ .compatible = "maxim,max98095", },
{ }
};
MODULE_DEVICE_TABLE(of, max98095_of_match);
+#endif

static struct i2c_driver max98095_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:22:44

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 30/38] ASoC: tlv320: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/tlv320aic23-i2c.c:38:34: warning: ‘tlv320aic23_of_match’ defined but not used [-Wunused-const-variable=]
sound/soc/codecs/tlv320adcx140.c:1076:34: warning: ‘tlv320adcx140_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/tlv320adcx140.c | 2 ++
sound/soc/codecs/tlv320aic23-i2c.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 53a80246aee1..3f027c8234a6 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -1073,6 +1073,7 @@ static struct snd_soc_dai_driver adcx140_dai_driver[] = {
}
};

+#ifdef CONFIG_OF
static const struct of_device_id tlv320adcx140_of_match[] = {
{ .compatible = "ti,tlv320adc3140" },
{ .compatible = "ti,tlv320adc5140" },
@@ -1080,6 +1081,7 @@ static const struct of_device_id tlv320adcx140_of_match[] = {
{},
};
MODULE_DEVICE_TABLE(of, tlv320adcx140_of_match);
+#endif

static int adcx140_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
diff --git a/sound/soc/codecs/tlv320aic23-i2c.c b/sound/soc/codecs/tlv320aic23-i2c.c
index 5025e5c43783..dbb8f969274c 100644
--- a/sound/soc/codecs/tlv320aic23-i2c.c
+++ b/sound/soc/codecs/tlv320aic23-i2c.c
@@ -35,11 +35,13 @@ static const struct i2c_device_id tlv320aic23_id[] = {

MODULE_DEVICE_TABLE(i2c, tlv320aic23_id);

+#ifdef CONFIG_OF
static const struct of_device_id tlv320aic23_of_match[] = {
{ .compatible = "ti,tlv320aic23", },
{ }
};
MODULE_DEVICE_TABLE(of, tlv320aic23_of_match);
+#endif

static struct i2c_driver tlv320aic23_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:22:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 22/38] ASoC: max98371: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max98371.c:411:34: warning: ‘max98371_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98371.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c
index dfee05f985bd..0b438303e1d5 100644
--- a/sound/soc/codecs/max98371.c
+++ b/sound/soc/codecs/max98371.c
@@ -408,11 +408,13 @@ static const struct i2c_device_id max98371_i2c_id[] = {

MODULE_DEVICE_TABLE(i2c, max98371_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max98371_of_match[] = {
{ .compatible = "maxim,max98371", },
{ }
};
MODULE_DEVICE_TABLE(of, max98371_of_match);
+#endif

static struct i2c_driver max98371_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:23:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 17/38] ASoC: da7219: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/da7219.c:1705:34: warning: ‘da7219_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/da7219.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 0b3b7909efc9..e9b45daec0ca 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1702,11 +1702,13 @@ static struct snd_soc_dai_driver da7219_dai = {
* DT/ACPI
*/

+#ifdef CONFIG_OF
static const struct of_device_id da7219_of_match[] = {
{ .compatible = "dlg,da7219", },
{ }
};
MODULE_DEVICE_TABLE(of, da7219_of_match);
+#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id da7219_acpi_match[] = {
--
2.25.1

2020-11-20 16:23:30

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 38/38] ASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()

of_match_device() already handles properly !CONFIG_OF case, so passing
the argument via of_match_ptr() is not needed.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/samsung/smdk_wm8994.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 696ab6abd1f6..8166e41e685b 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -170,7 +170,7 @@ static int smdk_audio_probe(struct platform_device *pdev)
smdk_dai[0].platforms->of_node = smdk_dai[0].cpus->of_node;
}

- id = of_match_device(of_match_ptr(samsung_wm8994_of_match), &pdev->dev);
+ id = of_match_device(samsung_wm8994_of_match, &pdev->dev);
if (id)
*board = *((struct smdk_wm8994_data *)id->data);

--
2.25.1

2020-11-20 16:23:32

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 16/38] ASoC: da7218: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/da7218.c:2281:34: warning: ‘da7218_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/da7218.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 6d78bccb55c3..2bfafbe9e3dc 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -2278,12 +2278,14 @@ static irqreturn_t da7218_irq_thread(int irq, void *data)
* DT
*/

+#ifdef CONFIG_OF
static const struct of_device_id da7218_of_match[] = {
{ .compatible = "dlg,da7217", .data = (void *) DA7217_DEV_ID },
{ .compatible = "dlg,da7218", .data = (void *) DA7218_DEV_ID },
{ }
};
MODULE_DEVICE_TABLE(of, da7218_of_match);
+#endif

static inline int da7218_of_get_id(struct device *dev)
{
--
2.25.1

2020-11-20 16:23:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 13/38] ASoC: ak4118: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/ak4118.c:407:34: warning: ‘ak4118_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/ak4118.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c
index f44d9a4a8507..5d46ae85566c 100644
--- a/sound/soc/codecs/ak4118.c
+++ b/sound/soc/codecs/ak4118.c
@@ -404,11 +404,13 @@ static int ak4118_i2c_probe(struct i2c_client *i2c,
&soc_component_drv_ak4118, &ak4118_dai, 1);
}

+#ifdef CONFIG_OF
static const struct of_device_id ak4118_of_match[] = {
{ .compatible = "asahi-kasei,ak4118", },
{}
};
MODULE_DEVICE_TABLE(of, ak4118_of_match);
+#endif

static const struct i2c_device_id ak4118_id_table[] = {
{ "ak4118", 0 },
--
2.25.1

2020-11-20 16:23:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 10/38] ASoC: rockchip: drop of_match_ptr from of_device_id table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here). This fixes
compile warning (!CONFIG_OF on x86_64):

sound/soc/rockchip/rockchip_i2s.c:569:34: warning: ‘rockchip_i2s_match’ defined but not used [-Wunused-const-variable=]
sound/soc/rockchip/rockchip_pdm.c:463:34: warning: ‘rockchip_pdm_match’ defined but not used [-Wunused-const-variable=]
sound/soc/rockchip/rockchip_spdif.c:44:34: warning: ‘rk_spdif_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/rockchip/rockchip_i2s.c | 2 +-
sound/soc/rockchip/rockchip_pdm.c | 2 +-
sound/soc/rockchip/rockchip_spdif.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 593299675b8c..39d7ce1f53a7 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -714,7 +714,7 @@ static struct platform_driver rockchip_i2s_driver = {
.remove = rockchip_i2s_remove,
.driver = {
.name = DRV_NAME,
- .of_match_table = of_match_ptr(rockchip_i2s_match),
+ .of_match_table = rockchip_i2s_match,
.pm = &rockchip_i2s_pm_ops,
},
};
diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index 5adb293d0435..171b55e4010a 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -614,7 +614,7 @@ static struct platform_driver rockchip_pdm_driver = {
.remove = rockchip_pdm_remove,
.driver = {
.name = "rockchip-pdm",
- .of_match_table = of_match_ptr(rockchip_pdm_match),
+ .of_match_table = rockchip_pdm_match,
.pm = &rockchip_pdm_pm_ops,
},
};
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index 674810851fbc..9869da7bccea 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -381,7 +381,7 @@ static struct platform_driver rk_spdif_driver = {
.remove = rk_spdif_remove,
.driver = {
.name = "rockchip-spdif",
- .of_match_table = of_match_ptr(rk_spdif_match),
+ .of_match_table = rk_spdif_match,
.pm = &rk_spdif_pm_ops,
},
};
--
2.25.1

2020-11-20 16:23:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 23/38] ASoC: max9867: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/max9867.c:652:34: warning: ‘max9867_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max9867.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index aef2746bfb94..512e6f2513d3 100644
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -649,11 +649,13 @@ static const struct i2c_device_id max9867_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max9867_i2c_id);

+#ifdef CONFIG_OF
static const struct of_device_id max9867_of_match[] = {
{ .compatible = "maxim,max9867", },
{ }
};
MODULE_DEVICE_TABLE(of, max9867_of_match);
+#endif

static struct i2c_driver max9867_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:23:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 26/38] ASoC: pcm1789: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/pcm1789-i2c.c:36:34: warning: ‘pcm1789_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/pcm1789-i2c.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/pcm1789-i2c.c b/sound/soc/codecs/pcm1789-i2c.c
index 327ec584f240..7a6be45f8149 100644
--- a/sound/soc/codecs/pcm1789-i2c.c
+++ b/sound/soc/codecs/pcm1789-i2c.c
@@ -33,11 +33,13 @@ static int pcm1789_i2c_remove(struct i2c_client *client)
return pcm1789_common_exit(&client->dev);
}

+#ifdef CONFIG_OF
static const struct of_device_id pcm1789_of_match[] = {
{ .compatible = "ti,pcm1789", },
{ }
};
MODULE_DEVICE_TABLE(of, pcm1789_of_match);
+#endif

static const struct i2c_device_id pcm1789_i2c_ids[] = {
{ "pcm1789", 0 },
--
2.25.1

2020-11-20 16:24:02

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 29/38] ASoC: tas2562: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/tas2562.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
index f1ff204e3ad0..19965fabe949 100644
--- a/sound/soc/codecs/tas2562.c
+++ b/sound/soc/codecs/tas2562.c
@@ -802,6 +802,7 @@ static const struct i2c_device_id tas2562_id[] = {
};
MODULE_DEVICE_TABLE(i2c, tas2562_id);

+#ifdef CONFIG_OF
static const struct of_device_id tas2562_of_match[] = {
{ .compatible = "ti,tas2562", },
{ .compatible = "ti,tas2563", },
@@ -810,6 +811,7 @@ static const struct of_device_id tas2562_of_match[] = {
{ },
};
MODULE_DEVICE_TABLE(of, tas2562_of_match);
+#endif

static struct i2c_driver tas2562_i2c_driver = {
.driver = {
--
2.25.1

2020-11-20 16:24:03

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 35/38] ASoC: max98371: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98371.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c
index 0b438303e1d5..e424779db02b 100644
--- a/sound/soc/codecs/max98371.c
+++ b/sound/soc/codecs/max98371.c
@@ -419,7 +419,6 @@ MODULE_DEVICE_TABLE(of, max98371_of_match);
static struct i2c_driver max98371_i2c_driver = {
.driver = {
.name = "max98371",
- .pm = NULL,
.of_match_table = of_match_ptr(max98371_of_match),
},
.probe = max98371_i2c_probe,
--
2.25.1

2020-11-20 16:24:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 33/38] ASoC: es7241: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

sound/soc/codecs/es7241.c:206:33: warning: ‘es7241_chip’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/es7241.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/es7241.c b/sound/soc/codecs/es7241.c
index 87991bd4acef..2344a0b03518 100644
--- a/sound/soc/codecs/es7241.c
+++ b/sound/soc/codecs/es7241.c
@@ -203,7 +203,7 @@ static const struct es7241_clock_mode es7241_modes[] = {
},
};

-static const struct es7241_chip es7241_chip = {
+static const struct es7241_chip es7241_chip __maybe_unused = {
.modes = es7241_modes,
.mode_num = ARRAY_SIZE(es7241_modes),
};
--
2.25.1

2020-11-20 16:24:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 31/38] ASoC: ts3a227e: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

sound/soc/codecs/ts3a227e.c:369:34: warning: ‘ts3a227e_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/ts3a227e.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 3ed3b45fa7ba..962f5d48378a 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -366,11 +366,13 @@ static const struct i2c_device_id ts3a227e_i2c_ids[] = {
};
MODULE_DEVICE_TABLE(i2c, ts3a227e_i2c_ids);

+#ifdef CONFIG_OF
static const struct of_device_id ts3a227e_of_match[] = {
{ .compatible = "ti,ts3a227e", },
{ }
};
MODULE_DEVICE_TABLE(of, ts3a227e_of_match);
+#endif

#ifdef CONFIG_ACPI
static struct acpi_device_id ts3a227e_acpi_match[] = {
--
2.25.1

2020-11-20 16:24:54

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 32/38] ASoC: es7134: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

sound/soc/codecs/es7134.c:264:33: warning: ‘es7154_chip’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/es7134.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/es7134.c b/sound/soc/codecs/es7134.c
index 00518406eb2b..e2b79879354b 100644
--- a/sound/soc/codecs/es7134.c
+++ b/sound/soc/codecs/es7134.c
@@ -183,7 +183,7 @@ static const struct snd_soc_dapm_route es7134_extra_routes[] = {
{ "Playback", NULL, "VDD", }
};

-static const struct es7134_chip es7134_chip = {
+static const struct es7134_chip es7134_chip __maybe_unused = {
.dai_drv = &es7134_dai,
.modes = es7134_modes,
.mode_num = ARRAY_SIZE(es7134_modes),
@@ -261,7 +261,7 @@ static const struct snd_soc_dapm_route es7154_extra_routes[] = {
{ "Playback", NULL, "PVDD", }
};

-static const struct es7134_chip es7154_chip = {
+static const struct es7134_chip es7154_chip __maybe_unused = {
.dai_drv = &es7154_dai,
.modes = es7154_modes,
.mode_num = ARRAY_SIZE(es7154_modes),
--
2.25.1

2020-11-20 16:25:10

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 34/38] ASoC: samsung: i2s: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

sound/soc/samsung/i2s.c:1646:42: warning: ‘i2sv5_dai_type_i2s1’ defined but not used [-Wunused-const-variable=]
sound/soc/samsung/i2s.c:1639:42: warning: ‘i2sv7_dai_type’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/samsung/i2s.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index df53d4ea808f..1e89f2a285a9 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1622,28 +1622,28 @@ static const struct samsung_i2s_dai_data i2sv3_dai_type = {
.i2s_variant_regs = &i2sv3_regs,
};

-static const struct samsung_i2s_dai_data i2sv5_dai_type = {
+static const struct samsung_i2s_dai_data i2sv5_dai_type __maybe_unused = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
QUIRK_SUPPORTS_IDMA,
.pcm_rates = SNDRV_PCM_RATE_8000_96000,
.i2s_variant_regs = &i2sv3_regs,
};

-static const struct samsung_i2s_dai_data i2sv6_dai_type = {
+static const struct samsung_i2s_dai_data i2sv6_dai_type __maybe_unused = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
QUIRK_SUPPORTS_TDM | QUIRK_SUPPORTS_IDMA,
.pcm_rates = SNDRV_PCM_RATE_8000_96000,
.i2s_variant_regs = &i2sv6_regs,
};

-static const struct samsung_i2s_dai_data i2sv7_dai_type = {
+static const struct samsung_i2s_dai_data i2sv7_dai_type __maybe_unused = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
QUIRK_SUPPORTS_TDM,
.pcm_rates = SNDRV_PCM_RATE_8000_192000,
.i2s_variant_regs = &i2sv7_regs,
};

-static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 = {
+static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 __maybe_unused = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_NEED_RSTCLR,
.pcm_rates = SNDRV_PCM_RATE_8000_96000,
.i2s_variant_regs = &i2sv5_i2s1_regs,
--
2.25.1

2020-11-20 16:25:14

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 37/38] ASoC: max98926: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98926.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/sound/soc/codecs/max98926.c b/sound/soc/codecs/max98926.c
index 0977e541326d..f286e572263e 100644
--- a/sound/soc/codecs/max98926.c
+++ b/sound/soc/codecs/max98926.c
@@ -583,7 +583,6 @@ static struct i2c_driver max98926_i2c_driver = {
.driver = {
.name = "max98926",
.of_match_table = of_match_ptr(max98926_of_match),
- .pm = NULL,
},
.probe = max98926_i2c_probe,
.id_table = max98926_i2c_id,
--
2.25.1

2020-11-20 16:25:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 36/38] ASoC: max98925: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
sound/soc/codecs/max98925.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c
index e18d0022c3f4..ddaccc24b0cb 100644
--- a/sound/soc/codecs/max98925.c
+++ b/sound/soc/codecs/max98925.c
@@ -639,7 +639,6 @@ static struct i2c_driver max98925_i2c_driver = {
.driver = {
.name = "max98925",
.of_match_table = of_match_ptr(max98925_of_match),
- .pm = NULL,
},
.probe = max98925_i2c_probe,
.id_table = max98925_i2c_id,
--
2.25.1

2020-11-20 16:26:48

by Dan Murphy

[permalink] [raw]
Subject: Re: [PATCH 29/38] ASoC: tas2562: skip of_device_id table when !CONFIG_OF

Hello

On 11/20/20 10:16 AM, Krzysztof Kozlowski wrote:
> The driver can match by multiple methods. Its of_device_id table is
> referenced via of_match_ptr() so it will be unused for !CONFIG_OF
> builds:
>
> sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> sound/soc/codecs/tas2562.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
> index f1ff204e3ad0..19965fabe949 100644
> --- a/sound/soc/codecs/tas2562.c
> +++ b/sound/soc/codecs/tas2562.c
> @@ -802,6 +802,7 @@ static const struct i2c_device_id tas2562_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, tas2562_id);
>
> +#ifdef CONFIG_OF

Should we use #if IS_ENABLED(CONFIG_OF) ?

Dan

2020-11-20 16:40:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 29/38] ASoC: tas2562: skip of_device_id table when !CONFIG_OF

On Fri, Nov 20, 2020 at 10:21:56AM -0600, Dan Murphy wrote:
> Hello
>
> On 11/20/20 10:16 AM, Krzysztof Kozlowski wrote:
> > The driver can match by multiple methods. Its of_device_id table is
> > referenced via of_match_ptr() so it will be unused for !CONFIG_OF
> > builds:
> >
> > sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]
> >
> > Signed-off-by: Krzysztof Kozlowski <[email protected]>
> > ---
> > sound/soc/codecs/tas2562.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
> > index f1ff204e3ad0..19965fabe949 100644
> > --- a/sound/soc/codecs/tas2562.c
> > +++ b/sound/soc/codecs/tas2562.c
> > @@ -802,6 +802,7 @@ static const struct i2c_device_id tas2562_id[] = {
> > };
> > MODULE_DEVICE_TABLE(i2c, tas2562_id);
> > +#ifdef CONFIG_OF
>
> Should we use #if IS_ENABLED(CONFIG_OF) ?

I think it does not matter:
1. OF is only bool,
2. This is the existing pattern in many driver (for OF and ACPI),
see also: Documentation/firmware-guide/acpi/enumeration.rst
3. ifdef should be faster for preprocessor (less macros to unwind),

It would matter if OF became a module option. In such case anyway a lot
of existing ifdef CONFIG_OF would have to be corrected.

Best regards,
Krzysztof

2020-11-20 16:45:10

by Sylwester Nawrocki

[permalink] [raw]
Subject: Re: [PATCH 34/38] ASoC: samsung: i2s: mark OF related data as maybe unused

On 11/20/20 17:16, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF making certain data
> unused:
>
> sound/soc/samsung/i2s.c:1646:42: warning: ‘i2sv5_dai_type_i2s1’ defined but not used [-Wunused-const-variable=]
> sound/soc/samsung/i2s.c:1639:42: warning: ‘i2sv7_dai_type’ defined but not used [-Wunused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski<[email protected]>

Reviewed-by: Sylwester Nawrocki <[email protected]>

2020-11-20 16:47:50

by Sylwester Nawrocki

[permalink] [raw]
Subject: Re: [PATCH 09/38] ASoC: samsung: smdk_wm8994: drop of_match_ptr from of_device_id table

On 11/20/20 17:16, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it is not relevant here). This fixes
> compile warning (!CONFIG_OF on x86_64):
>
> sound/soc/samsung/smdk_wm8994.c:139:34: warning: ‘samsung_wm8994_of_match’ defined but not used [-Wunused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski<[email protected]>

Reviewed-by: Sylwester Nawrocki <[email protected]>

2020-11-20 16:49:07

by Sylwester Nawrocki

[permalink] [raw]
Subject: Re: [PATCH 38/38] ASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()

On 11/20/20 17:16, Krzysztof Kozlowski wrote:
> of_match_device() already handles properly !CONFIG_OF case, so passing
> the argument via of_match_ptr() is not needed.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Sylwester Nawrocki <[email protected]>

2020-11-20 16:59:42

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Fri, Nov 20, 2020 at 05:16:15PM +0100, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it is not relevant here). This fixes
> compile warning (!CONFIG_OF on x86_64):

It would be better to fix these by annotating the table as potentially
unused, if nothing else it means if someone wants to add ACPI support
(or it just works on their ACPI system with the plain old I2C ID) then
they don't need to revert this change.


Attachments:
(No filename) (597.00 B)
signature.asc (499.00 B)
Download all attachments

2020-11-20 19:44:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Fri, Nov 20, 2020 at 04:56:34PM +0000, Mark Brown wrote:
> On Fri, Nov 20, 2020 at 05:16:15PM +0100, Krzysztof Kozlowski wrote:
> > The driver can match only via the DT table so the table should be always
> > used and the of_match_ptr does not have any sense (this also allows ACPI
> > matching via PRP0001, even though it is not relevant here). This fixes
> > compile warning (!CONFIG_OF on x86_64):
>
> It would be better to fix these by annotating the table as potentially
> unused, if nothing else it means if someone wants to add ACPI support
> (or it just works on their ACPI system with the plain old I2C ID) then
> they don't need to revert this change.

The point is after this patch - removal of of_match_ptr() - they will
already support the ACPI matching through the PRP0001.

Keeping of_match_ptr() and maybe_unused will prevent any ACPI re-usage
unless explicit ACPI table is added

Best regards,
Krzysztof

2020-11-20 20:08:57

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Fri, Nov 20, 2020 at 08:42:45PM +0100, Krzysztof Kozlowski wrote:
> On Fri, Nov 20, 2020 at 04:56:34PM +0000, Mark Brown wrote:

> > It would be better to fix these by annotating the table as potentially
> > unused, if nothing else it means if someone wants to add ACPI support
> > (or it just works on their ACPI system with the plain old I2C ID) then
> > they don't need to revert this change.

> The point is after this patch - removal of of_match_ptr() - they will
> already support the ACPI matching through the PRP0001.

> Keeping of_match_ptr() and maybe_unused will prevent any ACPI re-usage
> unless explicit ACPI table is added

Surely if that's the desired outcome the fix is to change the definition
of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
perhaps hidden behind a config option for PRP0001? That seems better
than going through the entire tree like this.


Attachments:
(No filename) (919.00 B)
signature.asc (499.00 B)
Download all attachments

2020-11-22 11:02:16

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
> On Fri, Nov 20, 2020 at 08:42:45PM +0100, Krzysztof Kozlowski wrote:
> > On Fri, Nov 20, 2020 at 04:56:34PM +0000, Mark Brown wrote:
>
> > > It would be better to fix these by annotating the table as potentially
> > > unused, if nothing else it means if someone wants to add ACPI support
> > > (or it just works on their ACPI system with the plain old I2C ID) then
> > > they don't need to revert this change.
>
> > The point is after this patch - removal of of_match_ptr() - they will
> > already support the ACPI matching through the PRP0001.
>
> > Keeping of_match_ptr() and maybe_unused will prevent any ACPI re-usage
> > unless explicit ACPI table is added
>
> Surely if that's the desired outcome the fix is to change the definition
> of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> perhaps hidden behind a config option for PRP0001? That seems better
> than going through the entire tree like this.

That could be indeed an easier way to achieve this.

+Cc Andy, Rafael,

I saw you were doing similar way as I did here [1] for the 698fffc2705c
("rtc: ds1307: Drop of_match_ptr and CONFIG_OF protections") with the
same reasoning as mine ("These prevent use of this driver with ACPI via
PRP0001.").

Do you have thoughts on Mark's proposal above (to change the
of_match_ptr())?

[1] https://lore.kernel.org/lkml/[email protected]/

Best regards,
Krzysztof

2020-11-23 10:51:07

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
> > On Fri, Nov 20, 2020 at 08:42:45PM +0100, Krzysztof Kozlowski wrote:
> > > On Fri, Nov 20, 2020 at 04:56:34PM +0000, Mark Brown wrote:
> >
> > > > It would be better to fix these by annotating the table as potentially
> > > > unused, if nothing else it means if someone wants to add ACPI support
> > > > (or it just works on their ACPI system with the plain old I2C ID) then
> > > > they don't need to revert this change.
> >
> > > The point is after this patch - removal of of_match_ptr() - they will
> > > already support the ACPI matching through the PRP0001.
> >
> > > Keeping of_match_ptr() and maybe_unused will prevent any ACPI re-usage
> > > unless explicit ACPI table is added
> >
> > Surely if that's the desired outcome the fix is to change the definition
> > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > perhaps hidden behind a config option for PRP0001? That seems better
> > than going through the entire tree like this.
>
> That could be indeed an easier way to achieve this.

...easier and wrong in my opinion. Not all drivers need that.
What the point to touch it in the driver which is OF-only?
(For IP which will quite unlikely to be present in ACPI world)
Or if the device will get the correct ACPI ID?

> +Cc Andy, Rafael,

I guess Rafael can correct me or others.

> I saw you were doing similar way as I did here [1] for the 698fffc2705c
> ("rtc: ds1307: Drop of_match_ptr and CONFIG_OF protections") with the
> same reasoning as mine ("These prevent use of this driver with ACPI via
> PRP0001.").

The above is a device which can be connected to any system, including
ACPI-based one. The patch has been cooked to have some means to make
it usable on such systems (because previous patch removes wrong ACPI IDs).

> Do you have thoughts on Mark's proposal above (to change the
> of_match_ptr())?
>
> [1] https://lore.kernel.org/lkml/[email protected]/

--
With Best Regards,
Andy Shevchenko


2020-11-23 12:42:37

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 12:48:32PM +0200, Andy Shevchenko wrote:
> On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> > On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:

> > > Surely if that's the desired outcome the fix is to change the definition
> > > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > > perhaps hidden behind a config option for PRP0001? That seems better
> > > than going through the entire tree like this.

> > That could be indeed an easier way to achieve this.

> ...easier and wrong in my opinion. Not all drivers need that.
> What the point to touch it in the driver which is OF-only?
> (For IP which will quite unlikely to be present in ACPI world)
> Or if the device will get the correct ACPI ID?

That feels like something that should be done with Kconfig dependencies
like a direct OF dependency (possibly a !PRP0001 dependency?) for the
driver or possibly with having a variant of_match_ptr() for things that
really don't want to support PRP0001. Just removing all the use of
of_match_ptr() is both noisy and confusing in that it looks like it's
creating issues to fix, it makes it hard to understand when and why one
should use the macro.


Attachments:
(No filename) (1.22 kB)
signature.asc (499.00 B)
Download all attachments

2020-11-23 13:44:23

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 01:41:29PM +0100, Krzysztof Kozlowski wrote:
> On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:
> > On Mon, Nov 23, 2020 at 12:48:32PM +0200, Andy Shevchenko wrote:
> > > On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> > > > On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
> >
> > > > > Surely if that's the desired outcome the fix is to change the definition
> > > > > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > > > > perhaps hidden behind a config option for PRP0001? That seems better
> > > > > than going through the entire tree like this.
> >
> > > > That could be indeed an easier way to achieve this.
> >
> > > ...easier and wrong in my opinion. Not all drivers need that.
> > > What the point to touch it in the driver which is OF-only?
> > > (For IP which will quite unlikely to be present in ACPI world)
> > > Or if the device will get the correct ACPI ID?
> >
> > That feels like something that should be done with Kconfig dependencies
> > like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> > driver or possibly with having a variant of_match_ptr() for things that
> > really don't want to support PRP0001. Just removing all the use of
> > of_match_ptr() is both noisy and confusing in that it looks like it's
> > creating issues to fix, it makes it hard to understand when and why one
> > should use the macro.
>
> For the OF-only drivers (without other ID table), there is no point to
> use the macro. Driver can bind only with DT, so what is the point of
> of_match_ptr? To skip the OF table when building without OF? Driver
> won't be usable at all in such case. So maybe for compile testing?
> There is no need to remove OF table for simple build tests.

I'm on the same page here.

--
With Best Regards,
Andy Shevchenko


2020-11-23 13:49:10

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 03:42:25PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 23, 2020 at 01:41:29PM +0100, Krzysztof Kozlowski wrote:
> > On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:
> > > On Mon, Nov 23, 2020 at 12:48:32PM +0200, Andy Shevchenko wrote:
> > > > On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> > > > > On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
> > >
> > > > > > Surely if that's the desired outcome the fix is to change the definition
> > > > > > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > > > > > perhaps hidden behind a config option for PRP0001? That seems better
> > > > > > than going through the entire tree like this.
> > >
> > > > > That could be indeed an easier way to achieve this.
> > >
> > > > ...easier and wrong in my opinion. Not all drivers need that.
> > > > What the point to touch it in the driver which is OF-only?
> > > > (For IP which will quite unlikely to be present in ACPI world)
> > > > Or if the device will get the correct ACPI ID?
> > >
> > > That feels like something that should be done with Kconfig dependencies
> > > like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> > > driver or possibly with having a variant of_match_ptr() for things that
> > > really don't want to support PRP0001. Just removing all the use of
> > > of_match_ptr() is both noisy and confusing in that it looks like it's
> > > creating issues to fix, it makes it hard to understand when and why one
> > > should use the macro.
> >
> > For the OF-only drivers (without other ID table), there is no point to
> > use the macro. Driver can bind only with DT, so what is the point of
> > of_match_ptr? To skip the OF table when building without OF? Driver
> > won't be usable at all in such case. So maybe for compile testing?
> > There is no need to remove OF table for simple build tests.
>
> I'm on the same page here.

I should have elaborated that under OF only I meant rather !ACPI. So, when it
has no ID tables, I agree that macro is not needed. But, for instance, I?C
device drivers tend to have table even for ->probe_new() callback to be able to
instantiate them via user space.

--
With Best Regards,
Andy Shevchenko


2020-11-23 13:54:31

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 01:41:29PM +0100, Krzysztof Kozlowski wrote:
> On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:

> > That feels like something that should be done with Kconfig dependencies
> > like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> > driver or possibly with having a variant of_match_ptr() for things that
> > really don't want to support PRP0001. Just removing all the use of
> > of_match_ptr() is both noisy and confusing in that it looks like it's
> > creating issues to fix, it makes it hard to understand when and why one
> > should use the macro.

> For the OF-only drivers (without other ID table), there is no point to
> use the macro. Driver can bind only with DT, so what is the point of
> of_match_ptr? To skip the OF table when building without OF? Driver
> won't be usable at all in such case. So maybe for compile testing?
> There is no need to remove OF table for simple build tests.

If nothing else it means you don't have to check if the driver is OF
only or not. I can see not bothering to add it but actively going round
removing some instances of it doesn't seem great, and it seems like
people will constantly be adding new uses on the basis that it's just
such an obviously correct thing to do.


Attachments:
(No filename) (1.26 kB)
signature.asc (499.00 B)
Download all attachments

2020-11-23 15:02:16

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 01:50:06PM +0000, Mark Brown wrote:
> On Mon, Nov 23, 2020 at 01:41:29PM +0100, Krzysztof Kozlowski wrote:
> > On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:
>
> > > That feels like something that should be done with Kconfig dependencies
> > > like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> > > driver or possibly with having a variant of_match_ptr() for things that
> > > really don't want to support PRP0001. Just removing all the use of
> > > of_match_ptr() is both noisy and confusing in that it looks like it's
> > > creating issues to fix, it makes it hard to understand when and why one
> > > should use the macro.
>
> > For the OF-only drivers (without other ID table), there is no point to
> > use the macro. Driver can bind only with DT, so what is the point of
> > of_match_ptr? To skip the OF table when building without OF? Driver
> > won't be usable at all in such case. So maybe for compile testing?
> > There is no need to remove OF table for simple build tests.
>
> If nothing else it means you don't have to check if the driver is OF
> only or not. I can see not bothering to add it but actively going round
> removing some instances of it doesn't seem great, and it seems like
> people will constantly be adding new uses on the basis that it's just
> such an obviously correct thing to do.

If my patch was not changing anything, I would agree that it might be
just a churn. But the patch fixes a real warning.

The other way of fixing warning is the one you proposed at beginning -
adding maybe_unused. Here we go to the second reason:

Having these of_match_ptr() for OF-only drivers is not the correct way
but rather something which is copied from existing drivers into new
ones. This is another reason for removing them - people will stop
copying this code all over again.

Best regards,
Krzysztof

2020-11-23 16:49:24

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 03:58:31PM +0100, Krzysztof Kozlowski wrote:

> Having these of_match_ptr() for OF-only drivers is not the correct way
> but rather something which is copied from existing drivers into new
> ones. This is another reason for removing them - people will stop
> copying this code all over again.

Well, it seems that the issue the PRP0001 people are having is that
they'd rather that there were fewer OF only drivers! More generally
it is good practice to write things as though there might be non-DT
support even if it's not there at the present time, it's easier to not
have to think if it's strictly needed and it helps anyone coming along
later who does want to use things elsewhere.


Attachments:
(No filename) (723.00 B)
signature.asc (499.00 B)
Download all attachments

2020-11-23 23:40:51

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:
> On Mon, Nov 23, 2020 at 12:48:32PM +0200, Andy Shevchenko wrote:
> > On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> > > On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
>
> > > > Surely if that's the desired outcome the fix is to change the definition
> > > > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > > > perhaps hidden behind a config option for PRP0001? That seems better
> > > > than going through the entire tree like this.
>
> > > That could be indeed an easier way to achieve this.
>
> > ...easier and wrong in my opinion. Not all drivers need that.
> > What the point to touch it in the driver which is OF-only?
> > (For IP which will quite unlikely to be present in ACPI world)
> > Or if the device will get the correct ACPI ID?
>
> That feels like something that should be done with Kconfig dependencies
> like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> driver or possibly with having a variant of_match_ptr() for things that
> really don't want to support PRP0001. Just removing all the use of
> of_match_ptr() is both noisy and confusing in that it looks like it's
> creating issues to fix, it makes it hard to understand when and why one
> should use the macro.

For the OF-only drivers (without other ID table), there is no point to
use the macro. Driver can bind only with DT, so what is the point of
of_match_ptr? To skip the OF table when building without OF? Driver
won't be usable at all in such case. So maybe for compile testing?
There is no need to remove OF table for simple build tests.

Best regards,
Krzysztof

2020-11-24 00:35:08

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 04:43:30PM +0000, Mark Brown wrote:
> On Mon, Nov 23, 2020 at 03:58:31PM +0100, Krzysztof Kozlowski wrote:
>
> > Having these of_match_ptr() for OF-only drivers is not the correct way
> > but rather something which is copied from existing drivers into new
> > ones. This is another reason for removing them - people will stop
> > copying this code all over again.
>
> Well, it seems that the issue the PRP0001 people are having is that
> they'd rather that there were fewer OF only drivers! More generally
> it is good practice to write things as though there might be non-DT
> support even if it's not there at the present time, it's easier to not
> have to think if it's strictly needed and it helps anyone coming along
> later who does want to use things elsewhere.

I understand. I will send therefore a v2 adding __maybe_unused to the OF
table.

Best regards,
Krzysztof

2020-11-24 02:46:12

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 01/38] ASoC: ak5558: drop of_match_ptr from of_device_id table

On Mon, Nov 23, 2020 at 12:37:31PM +0000, Mark Brown wrote:
> On Mon, Nov 23, 2020 at 12:48:32PM +0200, Andy Shevchenko wrote:
> > On Sun, Nov 22, 2020 at 11:59:20AM +0100, Krzysztof Kozlowski wrote:
> > > On Fri, Nov 20, 2020 at 08:04:29PM +0000, Mark Brown wrote:
>
> > > > Surely if that's the desired outcome the fix is to change the definition
> > > > of of_match_ptr() such that it leaves the reference with CONFIG_ACPI,
> > > > perhaps hidden behind a config option for PRP0001? That seems better
> > > > than going through the entire tree like this.
>
> > > That could be indeed an easier way to achieve this.
>
> > ...easier and wrong in my opinion. Not all drivers need that.
> > What the point to touch it in the driver which is OF-only?
> > (For IP which will quite unlikely to be present in ACPI world)
> > Or if the device will get the correct ACPI ID?
>
> That feels like something that should be done with Kconfig dependencies
> like a direct OF dependency (possibly a !PRP0001 dependency?) for the
> driver or possibly with having a variant of_match_ptr() for things that
> really don't want to support PRP0001. Just removing all the use of
> of_match_ptr() is both noisy and confusing in that it looks like it's
> creating issues to fix, it makes it hard to understand when and why one
> should use the macro.

My personal opinion is that in 99% using that macro (as well as ACPI_PTR() one)
is kinda mistake. We save dozen of bytes here and there by adding macro,
necessary ifdeferry, and dropping user to know that the driver might serve for
other device IDs as provided by OF / ACPI.

But I'm not the one who makes a decision here and I could see some want to have
a possibility to reduce their kernel memory footprint as much as possible.

--
With Best Regards,
Andy Shevchenko