Skip to content

Commit b406f5e

Browse files
shawnguo2andersson
authored andcommitted
clk: qcom: smd-rpm: Drop the use of struct rpm_cc
Considering that struct rpm_cc is now identical to rpm_smd_clk_desc, and function qcom_smdrpm_clk_hw_get() uses rpm_cc in a read-only manner, rpm_cc can be dropped by getting the function use rpm_smd_clk_desc directly. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 00a123e commit b406f5e

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

drivers/clk/qcom/clk-smd-rpm.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ struct clk_smd_rpm_req {
150150
__le32 value;
151151
};
152152

153-
struct rpm_cc {
154-
struct clk_smd_rpm **clks;
155-
size_t num_clks;
156-
};
157-
158153
struct rpm_smd_clk_desc {
159154
struct clk_smd_rpm **clks;
160155
size_t num_clks;
@@ -1157,20 +1152,19 @@ MODULE_DEVICE_TABLE(of, rpm_smd_clk_match_table);
11571152
static struct clk_hw *qcom_smdrpm_clk_hw_get(struct of_phandle_args *clkspec,
11581153
void *data)
11591154
{
1160-
struct rpm_cc *rcc = data;
1155+
const struct rpm_smd_clk_desc *desc = data;
11611156
unsigned int idx = clkspec->args[0];
11621157

1163-
if (idx >= rcc->num_clks) {
1158+
if (idx >= desc->num_clks) {
11641159
pr_err("%s: invalid index %u\n", __func__, idx);
11651160
return ERR_PTR(-EINVAL);
11661161
}
11671162

1168-
return rcc->clks[idx] ? &rcc->clks[idx]->hw : ERR_PTR(-ENOENT);
1163+
return desc->clks[idx] ? &desc->clks[idx]->hw : ERR_PTR(-ENOENT);
11691164
}
11701165

11711166
static int rpm_smd_clk_probe(struct platform_device *pdev)
11721167
{
1173-
struct rpm_cc *rcc;
11741168
int ret;
11751169
size_t num_clks, i;
11761170
struct qcom_smd_rpm *rpm;
@@ -1190,13 +1184,6 @@ static int rpm_smd_clk_probe(struct platform_device *pdev)
11901184
rpm_smd_clks = desc->clks;
11911185
num_clks = desc->num_clks;
11921186

1193-
rcc = devm_kzalloc(&pdev->dev, sizeof(*rcc), GFP_KERNEL);
1194-
if (!rcc)
1195-
return -ENOMEM;
1196-
1197-
rcc->clks = rpm_smd_clks;
1198-
rcc->num_clks = num_clks;
1199-
12001187
for (i = 0; i < num_clks; i++) {
12011188
if (!rpm_smd_clks[i])
12021189
continue;
@@ -1222,7 +1209,7 @@ static int rpm_smd_clk_probe(struct platform_device *pdev)
12221209
}
12231210

12241211
ret = devm_of_clk_add_hw_provider(&pdev->dev, qcom_smdrpm_clk_hw_get,
1225-
rcc);
1212+
(void *)desc);
12261213
if (ret)
12271214
goto err;
12281215

0 commit comments

Comments
 (0)