hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/hwtracing/intel_th/acpi.c
....@@ -37,15 +37,21 @@
3737 static int intel_th_acpi_probe(struct platform_device *pdev)
3838 {
3939 struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
40
+ struct resource resource[TH_MMIO_END];
4041 const struct acpi_device_id *id;
4142 struct intel_th *th;
43
+ int i, r;
4244
4345 id = acpi_match_device(intel_th_acpi_ids, &pdev->dev);
4446 if (!id)
4547 return -ENODEV;
4648
47
- th = intel_th_alloc(&pdev->dev, (void *)id->driver_data,
48
- pdev->resource, pdev->num_resources, -1);
49
+ for (i = 0, r = 0; i < pdev->num_resources && r < TH_MMIO_END; i++)
50
+ if (pdev->resource[i].flags &
51
+ (IORESOURCE_IRQ | IORESOURCE_MEM))
52
+ resource[r++] = pdev->resource[i];
53
+
54
+ th = intel_th_alloc(&pdev->dev, (void *)id->driver_data, resource, r);
4955 if (IS_ERR(th))
5056 return PTR_ERR(th);
5157