]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
rockchip: clk: guard set_parent implementations against OF_PLATDATA
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Thu, 25 Jan 2018 14:27:10 +0000 (15:27 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Sun, 28 Jan 2018 16:12:39 +0000 (17:12 +0100)
The set_parent implementations do not make sense when OF_PLATDATA is
enabled.  We guard these against OF_PLATDATA and don't populate the
set_parent-op when this is the case.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/clk/rockchip/clk_rk3288.c
drivers/clk/rockchip/clk_rk3368.c
drivers/clk/rockchip/clk_rk3399.c

index baa8122bd6ddcb246a144699b1b84292aa82eee5..552a71a82faf86db0aa022c48dba64ff173441d9 100644 (file)
@@ -842,7 +842,7 @@ static ulong rk3288_clk_set_rate(struct clk *clk, ulong rate)
        return new_rate;
 }
 
-static int rk3288_gmac_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3288_gmac_set_parent(struct clk *clk, struct clk *parent)
 {
        struct rk3288_clk_priv *priv = dev_get_priv(clk->dev);
        struct rk3288_cru *cru = priv->cru;
@@ -880,7 +880,7 @@ static int rk3288_gmac_set_parent(struct clk *clk, struct clk *parent)
        return -EINVAL;
 }
 
-static int rk3288_clk_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3288_clk_set_parent(struct clk *clk, struct clk *parent)
 {
        switch (clk->id) {
        case SCLK_MAC:
@@ -896,7 +896,9 @@ static int rk3288_clk_set_parent(struct clk *clk, struct clk *parent)
 static struct clk_ops rk3288_clk_ops = {
        .get_rate       = rk3288_clk_get_rate,
        .set_rate       = rk3288_clk_set_rate,
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        .set_parent     = rk3288_clk_set_parent,
+#endif
 };
 
 static int rk3288_clk_ofdata_to_platdata(struct udevice *dev)
index 3364e6ac93f5b85d0972a4af5d53312387b8225c..3ac9add527b928d826a62a1cd8cdecd15ae2337d 100644 (file)
@@ -520,7 +520,7 @@ static ulong rk3368_clk_set_rate(struct clk *clk, ulong rate)
        return ret;
 }
 
-static int rk3368_gmac_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3368_gmac_set_parent(struct clk *clk, struct clk *parent)
 {
        struct rk3368_clk_priv *priv = dev_get_priv(clk->dev);
        struct rk3368_cru *cru = priv->cru;
@@ -557,7 +557,7 @@ static int rk3368_gmac_set_parent(struct clk *clk, struct clk *parent)
        return -EINVAL;
 }
 
-static int rk3368_clk_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3368_clk_set_parent(struct clk *clk, struct clk *parent)
 {
        switch (clk->id) {
        case SCLK_MAC:
@@ -571,7 +571,9 @@ static int rk3368_clk_set_parent(struct clk *clk, struct clk *parent)
 static struct clk_ops rk3368_clk_ops = {
        .get_rate = rk3368_clk_get_rate,
        .set_rate = rk3368_clk_set_rate,
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        .set_parent = rk3368_clk_set_parent,
+#endif
 };
 
 static int rk3368_clk_probe(struct udevice *dev)
index e431ec8a51d35152274188c7c3d9e10c49757a2c..42926ba323b25b739544ab57ec5b479bfc1493ff 100644 (file)
@@ -943,7 +943,7 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong rate)
        return ret;
 }
 
-static int rk3399_gmac_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3399_gmac_set_parent(struct clk *clk, struct clk *parent)
 {
        struct rk3399_clk_priv *priv = dev_get_priv(clk->dev);
        const char *clock_output_name;
@@ -978,7 +978,7 @@ static int rk3399_gmac_set_parent(struct clk *clk, struct clk *parent)
        return -EINVAL;
 }
 
-static int rk3399_clk_set_parent(struct clk *clk, struct clk *parent)
+static int __maybe_unused rk3399_clk_set_parent(struct clk *clk, struct clk *parent)
 {
        switch (clk->id) {
        case SCLK_RMII_SRC:
@@ -1006,7 +1006,9 @@ static int rk3399_clk_enable(struct clk *clk)
 static struct clk_ops rk3399_clk_ops = {
        .get_rate = rk3399_clk_get_rate,
        .set_rate = rk3399_clk_set_rate,
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        .set_parent = rk3399_clk_set_parent,
+#endif
        .enable = rk3399_clk_enable,
 };