Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258217
b: refs/heads/master
c: e4b6381
h: refs/heads/master
i:
  258215: 7fcdfc7
v: v3
  • Loading branch information
Mark Rutland authored and Russell King committed Jun 29, 2011
1 parent e964e1a commit f2f578a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e73c34c3d522a60d9f7b38a7683076362bad98f5
refs/heads/master: e4b6381009d740bd3a97e6b841d8efe7fc70c1b7
20 changes: 18 additions & 2 deletions trunk/arch/arm/kernel/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,22 @@ static struct of_device_id armpmu_of_device_ids[] = {
{},
};

#define PLAT_MATCH_PMU(_name, _type) { \
.name = _name, \
.driver_data = _type, \
}

#define PLAT_MATCH_CPU(_name) PLAT_MATCH_PMU(_name, ARM_PMU_DEVICE_CPU)

static struct platform_device_id armpmu_plat_device_ids[] = {
PLAT_MATCH_CPU("arm-pmu"),
{},
};

enum arm_pmu_type armpmu_device_type(struct platform_device *pdev)
{
const struct of_device_id *of_id;
const struct platform_device_id *pdev_id;

/* provided by of_device_id table */
if (pdev->dev.of_node) {
Expand All @@ -72,8 +85,10 @@ enum arm_pmu_type armpmu_device_type(struct platform_device *pdev)
return (enum arm_pmu_type)of_id->data;
}

/* Provided by a 'legacy' platform_device */
return ARM_PMU_DEVICE_CPU;
/* Provided by platform_device_id table */
pdev_id = platform_get_device_id(pdev);
BUG_ON(!pdev_id);
return pdev_id->driver_data;
}

static int __devinit armpmu_device_probe(struct platform_device *pdev)
Expand All @@ -87,6 +102,7 @@ static struct platform_driver armpmu_driver = {
.of_match_table = armpmu_of_device_ids,
},
.probe = armpmu_device_probe,
.id_table = armpmu_plat_device_ids,
};

static int __init register_pmu_driver(void)
Expand Down

0 comments on commit f2f578a

Please sign in to comment.