forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/clk/uniphier/clk-uniphier-core.c
....@@ -1,16 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2016 Socionext Inc.
34 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
145 */
156
167 #include <linux/clk-provider.h>
....@@ -73,8 +64,7 @@
7364 for (p = data; p->name; p++)
7465 clk_num = max(clk_num, p->idx + 1);
7566
76
- hw_data = devm_kzalloc(dev,
77
- sizeof(*hw_data) + clk_num * sizeof(struct clk_hw *),
67
+ hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, clk_num),
7868 GFP_KERNEL);
7969 if (!hw_data)
8070 return -ENOMEM;