|
@@ -204,7 +204,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node)
|
|
rtc->base = of_io_request_and_map(node, 0, of_node_full_name(node));
|
|
rtc->base = of_io_request_and_map(node, 0, of_node_full_name(node));
|
|
if (IS_ERR(rtc->base)) {
|
|
if (IS_ERR(rtc->base)) {
|
|
pr_crit("Can't map RTC registers");
|
|
pr_crit("Can't map RTC registers");
|
|
- return;
|
|
|
|
|
|
+ goto err;
|
|
}
|
|
}
|
|
|
|
|
|
/* Switch to the external, more precise, oscillator */
|
|
/* Switch to the external, more precise, oscillator */
|
|
@@ -216,7 +216,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node)
|
|
|
|
|
|
/* Deal with old DTs */
|
|
/* Deal with old DTs */
|
|
if (!of_get_property(node, "clocks", NULL))
|
|
if (!of_get_property(node, "clocks", NULL))
|
|
- return;
|
|
|
|
|
|
+ goto err;
|
|
|
|
|
|
rtc->int_osc = clk_hw_register_fixed_rate_with_accuracy(NULL,
|
|
rtc->int_osc = clk_hw_register_fixed_rate_with_accuracy(NULL,
|
|
"rtc-int-osc",
|
|
"rtc-int-osc",
|
|
@@ -246,6 +246,10 @@ static void __init sun6i_rtc_clk_init(struct device_node *node)
|
|
clk_data->num = 1;
|
|
clk_data->num = 1;
|
|
clk_data->hws[0] = &rtc->hw;
|
|
clk_data->hws[0] = &rtc->hw;
|
|
of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
|
of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+err:
|
|
|
|
+ kfree(clk_data);
|
|
}
|
|
}
|
|
CLK_OF_DECLARE_DRIVER(sun6i_rtc_clk, "allwinner,sun6i-a31-rtc",
|
|
CLK_OF_DECLARE_DRIVER(sun6i_rtc_clk, "allwinner,sun6i-a31-rtc",
|
|
sun6i_rtc_clk_init);
|
|
sun6i_rtc_clk_init);
|