From: Suzuki K Poulose Date: Wed, 19 Jun 2019 19:52:53 +0000 (-0600) Subject: coresight: Make sure device uses DT for obsolete compatible check X-Git-Tag: Ubuntu-5.13.0-19.19~8153^2~72 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a15dab756b0f4687a7c3e9e54767f58fbc63c603;p=mirror_ubuntu-jammy-kernel.git coresight: Make sure device uses DT for obsolete compatible check 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. Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 6236a847bb0b..3423042e7a52 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 ee6ad34061a5..7e0514557920 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);