diff mbox series

[v3,15/30] coresight: Make sure device uses DT for obsolete compatible check

Message ID 1557226378-10131-16-git-send-email-suzuki.poulose@arm.com
State Superseded
Headers show
Series coresight: Support for ACPI bindings | expand

Commit Message

Suzuki K Poulose May 7, 2019, 10:52 a.m. UTC
As we prepare to add support for ACPI bindings, let us make sure we do
the compatible check only if we are sure we are dealing with a DT based
system.

Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

---
 drivers/hwtracing/coresight/coresight-funnel.c     | 3 ++-
 drivers/hwtracing/coresight/coresight-replicator.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.7.4

Comments

Mathieu Poirier May 13, 2019, 4:18 p.m. UTC | #1
On Tue, May 07, 2019 at 11:52:42AM +0100, Suzuki K Poulose wrote:
> As we prepare to add support for ACPI bindings, let us make sure we do

> the compatible check only if we are sure we are dealing with a DT based

> system.

> 

> Cc: Leo Yan <leo.yan@linaro.org>

> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>

> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

> ---

>  drivers/hwtracing/coresight/coresight-funnel.c     | 3 ++-

>  drivers/hwtracing/coresight/coresight-replicator.c | 3 ++-

>  2 files changed, 4 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c

> index 6236a84..3423042 100644

> --- a/drivers/hwtracing/coresight/coresight-funnel.c

> +++ b/drivers/hwtracing/coresight/coresight-funnel.c

> @@ -196,7 +196,8 @@ static int funnel_probe(struct device *dev, struct resource *res)

>  		dev->platform_data = pdata;

>  	}

>  

> -	if (of_device_is_compatible(np, "arm,coresight-funnel"))

> +	if (is_of_node(dev_fwnode(dev)) &&

> +	    of_device_is_compatible(dev->of_node, "arm,coresight-funnel"))

>  		pr_warn_once("Uses OBSOLETE CoreSight funnel binding\n");

>  

>  	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);

> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c

> index ee6ad34..7e05145 100644

> --- a/drivers/hwtracing/coresight/coresight-replicator.c

> +++ b/drivers/hwtracing/coresight/coresight-replicator.c

> @@ -187,7 +187,8 @@ static int replicator_probe(struct device *dev, struct resource *res)

>  		dev->platform_data = pdata;

>  	}

>  

> -	if (of_device_is_compatible(np, "arm,coresight-replicator"))

> +	if (is_of_node(dev_fwnode(dev)) &&

> +	    of_device_is_compatible(dev->of_node, "arm,coresight-replicator"))

>  		pr_warn_once("Uses OBSOLETE CoreSight replicator binding\n");


Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>


>  

>  	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);

> -- 

> 2.7.4

>
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index 6236a84..3423042 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -196,7 +196,8 @@  static int funnel_probe(struct device *dev, struct resource *res)
 		dev->platform_data = pdata;
 	}
 
-	if (of_device_is_compatible(np, "arm,coresight-funnel"))
+	if (is_of_node(dev_fwnode(dev)) &&
+	    of_device_is_compatible(dev->of_node, "arm,coresight-funnel"))
 		pr_warn_once("Uses OBSOLETE CoreSight funnel binding\n");
 
 	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index ee6ad34..7e05145 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -187,7 +187,8 @@  static int replicator_probe(struct device *dev, struct resource *res)
 		dev->platform_data = pdata;
 	}
 
-	if (of_device_is_compatible(np, "arm,coresight-replicator"))
+	if (is_of_node(dev_fwnode(dev)) &&
+	    of_device_is_compatible(dev->of_node, "arm,coresight-replicator"))
 		pr_warn_once("Uses OBSOLETE CoreSight replicator binding\n");
 
 	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);