clk: check hw and hw->dev before dereference it

Check hw and hw->dev before dereference it.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 786f4e8..319808d 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -57,6 +57,9 @@
 
 const char *clk_hw_get_name(const struct clk *hw)
 {
+	assert(hw);
+	assert(hw->dev);
+
 	return hw->dev->name;
 }