treewide: Try to avoid the preprocessor with OF_REAL
Convert some of these occurences to C code, where it is easy to do. This
should help encourage this approach to be used in new code.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index 209c726..7d31a9f 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -1402,11 +1402,12 @@
static int rk3399_clk_of_to_plat(struct udevice *dev)
{
-#if CONFIG_IS_ENABLED(OF_REAL)
- struct rk3399_clk_priv *priv = dev_get_priv(dev);
+ if (CONFIG_IS_ENABLED(OF_REAL)) {
+ struct rk3399_clk_priv *priv = dev_get_priv(dev);
- priv->cru = dev_read_addr_ptr(dev);
-#endif
+ priv->cru = dev_read_addr_ptr(dev);
+ }
+
return 0;
}
@@ -1614,11 +1615,12 @@
static int rk3399_pmuclk_of_to_plat(struct udevice *dev)
{
-#if CONFIG_IS_ENABLED(OF_REAL)
- struct rk3399_pmuclk_priv *priv = dev_get_priv(dev);
+ if (CONFIG_IS_ENABLED(OF_REAL)) {
+ struct rk3399_pmuclk_priv *priv = dev_get_priv(dev);
- priv->pmucru = dev_read_addr_ptr(dev);
-#endif
+ priv->pmucru = dev_read_addr_ptr(dev);
+ }
+
return 0;
}