[PATCH 5/9] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets
Arnd Bergmann
arnd at arndb.de
Fri Mar 13 05:07:06 PDT 2015
On Thursday 12 March 2015 18:31:15 Russell King wrote:
> +int __init dove_init_pmu(void)
> +{
> + struct device_node *np_pmu, *np;
> + struct pmu_data *pmu;
> + int ret, parent_irq;
> +
> + /* Lookup the PMU node */
> + np_pmu = of_find_compatible_node(NULL, NULL, "marvell,dove-pmu");
> + if (!np_pmu)
> + return 0;
What is the reason that this is not a platform_driver? I think you
should try to make it one, or explain in the changelog the reason
for not making it one. This obviously ties in with the question I
asked about who calls dove_init_pmu().
> + ret = of_parse_phandle_with_args(np, "resets", "#reset-cells",
> + 0, &args);
> + if (ret == 0) {
> + if (args.np == pmu->of_node)
> + domain->rst_mask = BIT(args.args[0]);
> + of_node_put(args.np);
> + }
In particular, manually parsing the "resets" property is something
we should try to avoid. With a platform driver, this could become
devm_reset_control_get(), otherwise I think of_reset_control_get()
would also do the right thing here.
Arnd
More information about the linux-arm-kernel
mailing list