From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH v3 01/13] soc: samsung: pmu: Provide global function to get PMU regmap Date: Thu, 26 Jan 2017 10:43:20 +0100 Message-ID: References: <1484833733-16082-1-git-send-email-m.szyprowski@samsung.com> <1484833733-16082-2-git-send-email-m.szyprowski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1484833733-16082-2-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org To: Marek Szyprowski Cc: "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" , linux-samsung-soc , Sylwester Nawrocki , Krzysztof Kozlowski , Tomasz Figa , Bartlomiej Zolnierkiewicz List-Id: linux-gpio@vger.kernel.org On Thu, Jan 19, 2017 at 2:48 PM, Marek Szyprowski 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 > Reviewed-by: Tomasz Figa 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: linus.walleij@linaro.org (Linus Walleij) Date: Thu, 26 Jan 2017 10:43:20 +0100 Subject: [PATCH v3 01/13] soc: samsung: pmu: Provide global function to get PMU regmap In-Reply-To: <1484833733-16082-2-git-send-email-m.szyprowski@samsung.com> References: <1484833733-16082-1-git-send-email-m.szyprowski@samsung.com> <1484833733-16082-2-git-send-email-m.szyprowski@samsung.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Jan 19, 2017 at 2:48 PM, Marek Szyprowski 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 > Reviewed-by: Tomasz Figa 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 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