summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/intel_th/intel_th.h
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2016-03-07 17:04:45 +0200
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>2016-04-08 16:11:58 +0300
commitf18a9531f6da9aba2920a3a5f166dba5a20592a0 (patch)
tree4e88611c1a4817d6d7a6dc81ef57e79527d18e08 /drivers/hwtracing/intel_th/intel_th.h
parente8644e4c2aa5c52c357f63af9cc17ef5dce38396 (diff)
intel_th: Fix activating a subdevice without a driver
If output subdevice driver is not loaded, activating it will try to call its ->activate method and crash. Fix this by explicitly checking for the driver. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Reviewed-by: Laurent Fert <laurent.fert@intel.com>
Diffstat (limited to 'drivers/hwtracing/intel_th/intel_th.h')
-rw-r--r--drivers/hwtracing/intel_th/intel_th.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index 15ebd48a29f2..0df22e30673d 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -151,6 +151,9 @@ struct intel_th_driver {
#define to_intel_th_driver(_d) \
container_of((_d), struct intel_th_driver, driver)
+#define to_intel_th_driver_or_null(_d) \
+ ((_d) ? to_intel_th_driver(_d) : NULL)
+
static inline struct intel_th_device *
to_intel_th_hub(struct intel_th_device *thdev)
{