.. | .. |
---|
37 | 37 | static int intel_th_acpi_probe(struct platform_device *pdev) |
---|
38 | 38 | { |
---|
39 | 39 | struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); |
---|
| 40 | + struct resource resource[TH_MMIO_END]; |
---|
40 | 41 | const struct acpi_device_id *id; |
---|
41 | 42 | struct intel_th *th; |
---|
| 43 | + int i, r; |
---|
42 | 44 | |
---|
43 | 45 | id = acpi_match_device(intel_th_acpi_ids, &pdev->dev); |
---|
44 | 46 | if (!id) |
---|
45 | 47 | return -ENODEV; |
---|
46 | 48 | |
---|
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); |
---|
49 | 55 | if (IS_ERR(th)) |
---|
50 | 56 | return PTR_ERR(th); |
---|
51 | 57 | |
---|