Skip to content

Commit 8e3e791

Browse files
Jordan Crouserobclark
authored andcommitted
drm/msm: Use generic bulk clock function
Remove the homebrewed bulk clock get function and replace it with devm_clk_bulk_get_all(). Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 518304c commit 8e3e791

4 files changed

Lines changed: 2 additions & 43 deletions

File tree

‎drivers/gpu/drm/msm/adreno/a6xx_gmu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu)
11721172

11731173
static int a6xx_gmu_clocks_probe(struct a6xx_gmu *gmu)
11741174
{
1175-
int ret = msm_clk_bulk_get(gmu->dev, &gmu->clocks);
1175+
int ret = devm_clk_bulk_get_all(gmu->dev, &gmu->clocks);
11761176

11771177
if (ret < 1)
11781178
return ret;

‎drivers/gpu/drm/msm/msm_drv.c‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -83,46 +83,6 @@ module_param(modeset, bool, 0600);
8383
* Util/helpers:
8484
*/
8585

86-
int msm_clk_bulk_get(struct device *dev, struct clk_bulk_data **bulk)
87-
{
88-
struct property *prop;
89-
const char *name;
90-
struct clk_bulk_data *local;
91-
int i = 0, ret, count;
92-
93-
count = of_property_count_strings(dev->of_node, "clock-names");
94-
if (count < 1)
95-
return 0;
96-
97-
local = devm_kcalloc(dev, sizeof(struct clk_bulk_data *),
98-
count, GFP_KERNEL);
99-
if (!local)
100-
return -ENOMEM;
101-
102-
of_property_for_each_string(dev->of_node, "clock-names", prop, name) {
103-
local[i].id = devm_kstrdup(dev, name, GFP_KERNEL);
104-
if (!local[i].id) {
105-
devm_kfree(dev, local);
106-
return -ENOMEM;
107-
}
108-
109-
i++;
110-
}
111-
112-
ret = devm_clk_bulk_get(dev, count, local);
113-
114-
if (ret) {
115-
for (i = 0; i < count; i++)
116-
devm_kfree(dev, (void *) local[i].id);
117-
devm_kfree(dev, local);
118-
119-
return ret;
120-
}
121-
122-
*bulk = local;
123-
return count;
124-
}
125-
12686
struct clk *msm_clk_bulk_get_clock(struct clk_bulk_data *bulk, int count,
12787
const char *name)
12888
{

‎drivers/gpu/drm/msm/msm_drv.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ static inline void msm_perf_debugfs_cleanup(struct msm_drm_private *priv) {}
398398
#endif
399399

400400
struct clk *msm_clk_get(struct platform_device *pdev, const char *name);
401-
int msm_clk_bulk_get(struct device *dev, struct clk_bulk_data **bulk);
402401

403402
struct clk *msm_clk_bulk_get_clock(struct clk_bulk_data *bulk, int count,
404403
const char *name);

‎drivers/gpu/drm/msm/msm_gpu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ static irqreturn_t irq_handler(int irq, void *data)
784784

785785
static int get_clocks(struct platform_device *pdev, struct msm_gpu *gpu)
786786
{
787-
int ret = msm_clk_bulk_get(&pdev->dev, &gpu->grp_clks);
787+
int ret = devm_clk_bulk_get_all(&pdev->dev, &gpu->grp_clks);
788788

789789
if (ret < 1) {
790790
gpu->nr_clocks = 0;

0 commit comments

Comments
 (0)