drivers/perf: arm_pmu: define armpmu_init_fn

We expect an ARM PMU's init function to have a particular prototype,
which we open-code in a few places. This is less than ideal, considering
that we cast a void value to this type in one location, and a mismatch
could easily be missed.

Add a typedef so that we can ensure this is consistent.

Signed-off-by: Mark Rutland <[email protected]>
Tested-by: Jeremy Linton <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
This commit is contained in:
Mark Rutland 2017-04-11 09:39:45 +01:00 • committed by Will Deacon
commit 083c52144a
2 changed files with 4 additions and 2 deletions

View file

@ -989,7 +989,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
const struct pmu_probe_info *probe_table)
{
const struct of_device_id *of_id;
const int (*init_fn)(struct arm_pmu *);
armpmu_init_fn init_fn;
struct device_node *node = pdev->dev.of_node;
struct arm_pmu *pmu;
int ret = -ENODEV;