diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 21b17d6ced6d..e55ddc12ed53 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3733,8 +3733,9 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw, struct clk *clk_hw_get_clk(struct clk_hw *hw, const char *con_id) { struct device *dev = hw->core->dev; + const char *name = dev ? dev_name(dev) : NULL; - return clk_hw_create_clk(dev, hw, dev_name(dev), con_id); + return clk_hw_create_clk(dev, hw, name, con_id); } EXPORT_SYMBOL(clk_hw_get_clk);