aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/intel_th
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2017-08-23 02:47:19 -0400
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>2018-03-28 11:47:21 -0400
commit661b0df8489a35da4ee8acaaf43f204a913ccfc9 (patch)
treef0d9b9cede5c0b5f7e6437040169b17ee9c2c6cc /drivers/hwtracing/intel_th
parentc2d2c7de972d7a08533bde622c36ff6feb112907 (diff)
intel_th: Pick up irq number from resources
Platform devices pass their IRQs around as resources, so as a convenience for the glue layer code, allow them pass the IRQ to the core driver in the resources array. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Diffstat (limited to 'drivers/hwtracing/intel_th')
-rw-r--r--drivers/hwtracing/intel_th/core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index d295b221e0bc..8f820c182240 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -805,7 +805,14 @@ intel_th_alloc(struct device *dev, struct intel_th_drvdata *drvdata,
805 struct resource *devres, unsigned int ndevres, int irq) 805 struct resource *devres, unsigned int ndevres, int irq)
806{ 806{
807 struct intel_th *th; 807 struct intel_th *th;
808 int err; 808 int err, r;
809
810 if (irq == -1)
811 for (r = 0; r < ndevres; r++)
812 if (devres[r].flags & IORESOURCE_IRQ) {
813 irq = devres[r].start;
814 break;
815 }
809 816
810 th = kzalloc(sizeof(*th), GFP_KERNEL); 817 th = kzalloc(sizeof(*th), GFP_KERNEL);
811 if (!th) 818 if (!th)