Thread (9 messages) 9 messages, 2 authors, 2013-03-06

[PATCH V2 1/4] ARM: tegra: pmc: convert PMC driver to support DT only

STALE4960d

From: Stephen Warren <hidden>
Date: 2013-02-27 18:53:40
Also in: linux-tegra

On 02/26/2013 07:28 PM, Joseph Lo wrote:
The Tegra kernel only support boot from DT now. Clean up the PMC driver
to support DT only, that includes:

* remove the ifdef of CONFIG_OF
* replace the static mapping of PMC addr to map from DT
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c
quoted hunk ↗ jump to hunk
 static inline void tegra_pmc_writel(u32 val, u32 reg)
 {
-	writel(val, IO_ADDRESS(TEGRA_PMC_BASE + reg));
+	writel(val, (tegra_pmc_base + reg));
There are redundant () there.
quoted hunk ↗ jump to hunk
+static void tegra_pmc_parse_dt(void)
 {
+	struct device_node *np;
 
+	np = of_find_matching_node(NULL, matches);
+	if (np) {
Why not:

BUG_ON(!np);

That way, you can get rid of if if/else blocks, and remove one level of
indentation throughout this function. I already mentioned this internally...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help