drm/amdgpu: cache psp runtime boot_cfg_bitmask in sw_int
[linux-2.6-microblaze.git] / drivers / clk / clk.c
index e2ec1b7..65508eb 100644 (file)
@@ -4540,6 +4540,9 @@ int of_clk_add_provider(struct device_node *np,
        struct of_clk_provider *cp;
        int ret;
 
+       if (!np)
+               return 0;
+
        cp = kzalloc(sizeof(*cp), GFP_KERNEL);
        if (!cp)
                return -ENOMEM;
@@ -4579,6 +4582,9 @@ int of_clk_add_hw_provider(struct device_node *np,
        struct of_clk_provider *cp;
        int ret;
 
+       if (!np)
+               return 0;
+
        cp = kzalloc(sizeof(*cp), GFP_KERNEL);
        if (!cp)
                return -ENOMEM;
@@ -4676,6 +4682,9 @@ void of_clk_del_provider(struct device_node *np)
 {
        struct of_clk_provider *cp;
 
+       if (!np)
+               return;
+
        mutex_lock(&of_clk_mutex);
        list_for_each_entry(cp, &of_clk_providers, link) {
                if (cp->node == np) {