clk-r8a7779.c (9095bf25ea08135a5b74875dd0e3eeaddc4218a0) clk-r8a7779.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb)
1/*
2 * r8a7779 Core CPG Clocks
3 *
4 * Copyright (C) 2013, 2014 Horms Solutions Ltd.
5 *
6 * Contact: Simon Horman <horms@verge.net.au>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 124 unchanged lines hidden (view full) ---

133
134 num_clks = of_property_count_strings(np, "clock-output-names");
135 if (num_clks < 0) {
136 pr_err("%s: failed to count clocks\n", __func__);
137 return;
138 }
139
140 cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
1/*
2 * r8a7779 Core CPG Clocks
3 *
4 * Copyright (C) 2013, 2014 Horms Solutions Ltd.
5 *
6 * Contact: Simon Horman <horms@verge.net.au>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 124 unchanged lines hidden (view full) ---

133
134 num_clks = of_property_count_strings(np, "clock-output-names");
135 if (num_clks < 0) {
136 pr_err("%s: failed to count clocks\n", __func__);
137 return;
138 }
139
140 cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
141 clks = kzalloc(CPG_NUM_CLOCKS * sizeof(*clks), GFP_KERNEL);
141 clks = kcalloc(CPG_NUM_CLOCKS, sizeof(*clks), GFP_KERNEL);
142 if (cpg == NULL || clks == NULL) {
143 /* We're leaking memory on purpose, there's no point in cleaning
144 * up as the system won't boot anyway.
145 */
146 return;
147 }
148
149 spin_lock_init(&cpg->lock);

--- 29 unchanged lines hidden ---
142 if (cpg == NULL || clks == NULL) {
143 /* We're leaking memory on purpose, there's no point in cleaning
144 * up as the system won't boot anyway.
145 */
146 return;
147 }
148
149 spin_lock_init(&cpg->lock);

--- 29 unchanged lines hidden ---