diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ac11cefc3191..32fd2853e8b2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3730,8 +3730,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);