summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-11-01 17:49:58 -0400
committerTom Rini <[email protected]>2023-11-01 17:49:58 -0400
commit658caf0bf14e163be78b6fc063d883d1252163a2 (patch)
treec873fa2b1e2e0bd095b9cf2cb9ff7af26923f750 /include
parent46ff7dd09653e9fb32440fcafb59d54096a1ff52 (diff)
parentc4b52fda6924e92c6745351f32c4cafc36034170 (diff)
Merge tag 'clk-2024.01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-clk
Clock changes for 2024.01-rc2 This contains several fixes for the clock core.
Diffstat (limited to 'include')
-rw-r--r--include/clk.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/clk.h b/include/clk.h
index d91285235f7..249c0e0ab42 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -223,9 +223,11 @@ struct clk *devm_clk_get(struct udevice *dev, const char *id);
static inline struct clk *devm_clk_get_optional(struct udevice *dev,
const char *id)
{
+ int ret;
struct clk *clk = devm_clk_get(dev, id);
- if (PTR_ERR(clk) == -ENODATA)
+ ret = PTR_ERR(clk);
+ if (ret == -ENODATA || ret == -ENOENT)
return NULL;
return clk;
@@ -243,7 +245,7 @@ static inline struct clk *devm_clk_get_optional(struct udevice *dev,
*
* Return: zero on success, or -ve error code.
*/
-int clk_release_all(struct clk *clk, int count);
+int clk_release_all(struct clk *clk, unsigned int count);
/**
* devm_clk_put - "free" a managed clock source
@@ -307,7 +309,7 @@ clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk)
return -ENOSYS;
}
-static inline int clk_release_all(struct clk *clk, int count)
+static inline int clk_release_all(struct clk *clk, unsigned int count)
{
return -ENOSYS;
}
@@ -335,7 +337,7 @@ static inline int clk_get_by_name_optional(struct udevice *dev,
int ret;
ret = clk_get_by_name(dev, name, clk);
- if (ret == -ENODATA)
+ if (ret == -ENODATA || ret == -ENOENT)
return 0;
return ret;
@@ -359,7 +361,7 @@ static inline int clk_get_by_name_nodev_optional(ofnode node, const char *name,
int ret;
ret = clk_get_by_name_nodev(node, name, clk);
- if (ret == -ENODATA)
+ if (ret == -ENODATA || ret == -ENOENT)
return 0;
return ret;