Message ID | 20160219093959.GV19428@n2100.arm.linux.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c index 19fed65587e8..05cca9298f44 100644 --- a/drivers/clk/clk-gpio.c +++ b/drivers/clk/clk-gpio.c @@ -287,15 +287,12 @@ static void __init of_gpio_clk_setup(struct device_node *node, const char **parent_names; int i, num_parents; - num_parents = of_clk_get_parent_count(node); - if (num_parents < 0) - return; - data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return; - if (num_parents) { + num_parents = of_clk_get_parent_count(node); + if (num_parents > 0) { parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL); if (!parent_names) { kfree(data);