Thread (50 messages) 50 messages, 4 authors, 2017-01-27

[PATCH v3 01/13] soc: samsung: pmu: Provide global function to get PMU regmap

From: Linus Walleij <hidden>
Date: 2017-01-26 09:43:20
Also in: linux-gpio, linux-pm, linux-samsung-soc

On Thu, Jan 19, 2017 at 2:48 PM, Marek Szyprowski
[off-list ref] wrote:
PMU is something like a SoC wide service, so add a helper function to get
PMU regmap. This will be used by other Exynos device drivers. This way it
can be avoided to model this dependency in device tree (as phandles to PMU
node) for almost every device in the SoC.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Tomasz Figa <redacted>
But why? I could understand it as a local header in
drivers/soc/samsung/*.h for those files.

For the global kernel scope we usually look up the syscon
regmap we need using a phandle, DT node or even
compatible string directly from the device tree.

Just
#include <linux/mfd/syscon.h>

syscon_node_to_regmap()
syscon_regmap_lookup_by_compatible()
syscon_regmap_lookup_by_pdevname()
syscon_regmap_lookup_by_phandle()

what is wrong with just using one of these?

Introducing a special header just creates compile time problems
with global interfaces when merging code and just litter the kernel
for no good reason.

Can you explain why this necessarily different approach is
needed?

I guess I should have said this earlier, mea culpa.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help