summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/intel_th/acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwtracing/intel_th/acpi.c')
-rw-r--r--drivers/hwtracing/intel_th/acpi.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/hwtracing/intel_th/acpi.c b/drivers/hwtracing/intel_th/acpi.c
index 87bc3744755f..b528e5b113ff 100644
--- a/drivers/hwtracing/intel_th/acpi.c
+++ b/drivers/hwtracing/intel_th/acpi.c
@@ -37,15 +37,23 @@ MODULE_DEVICE_TABLE(acpi, intel_th_acpi_ids);
static int intel_th_acpi_probe(struct platform_device *pdev)
{
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
+ struct resource resource[TH_MMIO_END];
const struct acpi_device_id *id;
struct intel_th *th;
+ int i, r, irq = -1;
id = acpi_match_device(intel_th_acpi_ids, &pdev->dev);
if (!id)
return -ENODEV;
- th = intel_th_alloc(&pdev->dev, (void *)id->driver_data,
- pdev->resource, pdev->num_resources, -1);
+ for (i = 0, r = 0; i < pdev->num_resources && r < TH_MMIO_END; i++)
+ if (pdev->resource[i].flags & IORESOURCE_IRQ)
+ irq = pdev->resource[i].start;
+ else if (pdev->resource[i].flags & IORESOURCE_MEM)
+ resource[r++] = pdev->resource[i];
+
+ th = intel_th_alloc(&pdev->dev, (void *)id->driver_data, resource, r,
+ irq);
if (IS_ERR(th))
return PTR_ERR(th);