coresight: cti: Fix bug clearing sysfs links on callback
authorMike Leach <mike.leach@linaro.org>
Mon, 28 Sep 2020 16:35:06 +0000 (10:35 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Sep 2020 17:47:41 +0000 (19:47 +0200)
commitcab280bf3533c72f95ebdb65ce534b5cdc4729dc
treeee3be9a7730502e91da1b60a42aa0d9009fb9cee
parent1cce921bce7dcf6fef9bdfa4dcc9406383274408
coresight: cti: Fix bug clearing sysfs links on callback

During module unload, a coresight driver module will call back into
the CTI driver to remove any links between the two devices.

The current code has 2 issues:-
1) in the CTI driver the matching code is matching to the wrong device
so misses all the links.
2) The callback is called too late in the unload process resulting in a
crash.

This fixes both the issues.

Fixes: 177af8285b59 ("coresight: cti: Enable CTI associated with devices")
Reported-by: Tingwei Zhang <tingwei@codeaurora.org>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200928163513.70169-19-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-cti.c
drivers/hwtracing/coresight/coresight.c