Skip to content

Commit 4d02373

Browse files
Varadarajan Narayananbroonie
authored andcommitted
spi: qup: Fix QUP version identify method
Use of_device_get_match_data to identify QUP version instead of of_device_is_compatible. Signed-off-by: Varadarajan Narayanan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent cd595b9 commit 4d02373

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/spi/spi-qup.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/list.h>
2020
#include <linux/module.h>
2121
#include <linux/of.h>
22+
#include <linux/of_device.h>
2223
#include <linux/platform_device.h>
2324
#include <linux/pm_runtime.h>
2425
#include <linux/spi/spi.h>
@@ -1058,9 +1059,7 @@ static int spi_qup_probe(struct platform_device *pdev)
10581059
else if (!ret)
10591060
master->can_dma = spi_qup_can_dma;
10601061

1061-
/* set v1 flag if device is version 1 */
1062-
if (of_device_is_compatible(dev->of_node, "qcom,spi-qup-v1.1.1"))
1063-
controller->qup_v1 = 1;
1062+
controller->qup_v1 = (int)of_device_get_match_data(dev);
10641063

10651064
if (!controller->qup_v1)
10661065
master->set_cs = spi_qup_set_cs;
@@ -1256,7 +1255,7 @@ static int spi_qup_remove(struct platform_device *pdev)
12561255
}
12571256

12581257
static const struct of_device_id spi_qup_dt_match[] = {
1259-
{ .compatible = "qcom,spi-qup-v1.1.1", },
1258+
{ .compatible = "qcom,spi-qup-v1.1.1", .data = (void *)1, },
12601259
{ .compatible = "qcom,spi-qup-v2.1.1", },
12611260
{ .compatible = "qcom,spi-qup-v2.2.1", },
12621261
{ }

0 commit comments

Comments
 (0)