Skip to content

Commit b1da66d

Browse files
committed
Merge tag 'samsung-clk-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into clk-samsung
Pull Samsung SoC clk drivers updates from Krzysztof Kozlowski: - exynos-clkout: Remove usage of of_device_id table as .of_match_table, because the driver is instantiated as MFD cell, not as standalone platform driver. Populated .of_match_table confused people few times to convert the code to device_get_match_data(), which broke the driver. - Mark one of UFS clocks as critical, because having it off stops the system from shutdown - Use kmemdup_array() when applicable * tag 'samsung-clk-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: clk: samsung: gs101: mark gout_hsi2_ufs_embd_i_clk_unipro as critical clk: samsung: Switch to use kmemdup_array() clk: samsung: exynos-clkout: Remove misleading of_match_table/MODULE_DEVICE_TABLE
2 parents 1613e60 + e61f400 commit b1da66d

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

drivers/clk/samsung/clk-cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ static int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx,
689689
for (num_cfgs = 0; clk_data->cfg[num_cfgs].prate != 0; )
690690
num_cfgs++;
691691

692-
cpuclk->cfg = kmemdup(clk_data->cfg, sizeof(*clk_data->cfg) * num_cfgs,
693-
GFP_KERNEL);
692+
cpuclk->cfg = kmemdup_array(clk_data->cfg, num_cfgs, sizeof(*cpuclk->cfg),
693+
GFP_KERNEL);
694694
if (!cpuclk->cfg) {
695695
ret = -ENOMEM;
696696
goto unregister_clk_nb;

drivers/clk/samsung/clk-exynos-clkout.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <linux/platform_device.h>
1818
#include <linux/pm.h>
1919

20+
#define DRV_NAME "exynos-clkout"
21+
2022
#define EXYNOS_CLKOUT_NR_CLKS 1
2123
#define EXYNOS_CLKOUT_PARENTS 32
2224

@@ -75,7 +77,6 @@ static const struct of_device_id exynos_clkout_ids[] = {
7577
.data = &exynos_clkout_exynos5,
7678
}, { }
7779
};
78-
MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
7980

8081
/*
8182
* Device will be instantiated as child of PMU device without its own
@@ -236,8 +237,7 @@ static SIMPLE_DEV_PM_OPS(exynos_clkout_pm_ops, exynos_clkout_suspend,
236237

237238
static struct platform_driver exynos_clkout_driver = {
238239
.driver = {
239-
.name = "exynos-clkout",
240-
.of_match_table = exynos_clkout_ids,
240+
.name = DRV_NAME,
241241
.pm = &exynos_clkout_pm_ops,
242242
},
243243
.probe = exynos_clkout_probe,
@@ -248,4 +248,5 @@ module_platform_driver(exynos_clkout_driver);
248248
MODULE_AUTHOR("Krzysztof Kozlowski <[email protected]>");
249249
MODULE_AUTHOR("Tomasz Figa <[email protected]>");
250250
MODULE_DESCRIPTION("Samsung Exynos clock output driver");
251+
MODULE_ALIAS("platform:" DRV_NAME);
251252
MODULE_LICENSE("GPL");

drivers/clk/samsung/clk-gs101.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,7 @@ static const struct samsung_gate_clock hsi2_gate_clks[] __initconst = {
28462846
GATE(CLK_GOUT_HSI2_UFS_EMBD_I_CLK_UNIPRO,
28472847
"gout_hsi2_ufs_embd_i_clk_unipro", "mout_hsi2_ufs_embd_user",
28482848
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UFS_EMBD_IPCLKPORT_I_CLK_UNIPRO,
2849-
21, 0, 0),
2849+
21, CLK_IS_CRITICAL, 0),
28502850
GATE(CLK_GOUT_HSI2_UFS_EMBD_I_FMP_CLK,
28512851
"gout_hsi2_ufs_embd_i_fmp_clk", "mout_hsi2_bus_user",
28522852
CLK_CON_GAT_GOUT_BLK_HSI2_UID_UFS_EMBD_IPCLKPORT_I_FMP_CLK,

drivers/clk/samsung/clk-pll.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,10 +1286,10 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,
12861286
len++;
12871287

12881288
pll->rate_count = len;
1289-
pll->rate_table = kmemdup(pll_clk->rate_table,
1290-
pll->rate_count *
1291-
sizeof(struct samsung_pll_rate_table),
1292-
GFP_KERNEL);
1289+
pll->rate_table = kmemdup_array(pll_clk->rate_table,
1290+
pll->rate_count,
1291+
sizeof(*pll->rate_table),
1292+
GFP_KERNEL);
12931293
WARN(!pll->rate_table,
12941294
"%s: could not allocate rate table for %s\n",
12951295
__func__, pll_clk->name);

0 commit comments

Comments
 (0)