Skip to content

Commit ddddfaf

Browse files
M-Vaittinenbebarino
authored andcommitted
clk: BD718x7: Do not depend on parent driver data
The bd718x7 only needs a regmap from parent device. This can be obtained by call to dev_get_regmap. Do not require parent to populate the driver data for this. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 5c8fe58 commit ddddfaf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/clk/clk-bd718x7.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ struct bd718xx_clk {
3131
u8 reg;
3232
u8 mask;
3333
struct platform_device *pdev;
34-
struct rohm_regmap_dev *mfd;
34+
struct regmap *regmap;
3535
};
3636

3737
static int bd71837_clk_set(struct bd718xx_clk *c, unsigned int status)
3838
{
39-
return regmap_update_bits(c->mfd->regmap, c->reg, c->mask, status);
39+
return regmap_update_bits(c->regmap, c->reg, c->mask, status);
4040
}
4141

4242
static void bd71837_clk_disable(struct clk_hw *hw)
@@ -62,7 +62,7 @@ static int bd71837_clk_is_enabled(struct clk_hw *hw)
6262
int rval;
6363
struct bd718xx_clk *c = container_of(hw, struct bd718xx_clk, hw);
6464

65-
rval = regmap_read(c->mfd->regmap, c->reg, &enabled);
65+
rval = regmap_read(c->regmap, c->reg, &enabled);
6666

6767
if (rval)
6868
return rval;
@@ -82,7 +82,6 @@ static int bd71837_clk_probe(struct platform_device *pdev)
8282
int rval = -ENOMEM;
8383
const char *parent_clk;
8484
struct device *parent = pdev->dev.parent;
85-
struct rohm_regmap_dev *mfd = dev_get_drvdata(parent);
8685
struct clk_init_data init = {
8786
.name = "bd718xx-32k-out",
8887
.ops = &bd71837_clk_ops,
@@ -93,6 +92,10 @@ static int bd71837_clk_probe(struct platform_device *pdev)
9392
if (!c)
9493
return -ENOMEM;
9594

95+
c->regmap = dev_get_regmap(pdev->dev.parent, NULL);
96+
if (!c->regmap)
97+
return -ENODEV;
98+
9699
init.num_parents = 1;
97100
parent_clk = of_clk_get_parent_name(parent->of_node, 0);
98101

@@ -119,7 +122,6 @@ static int bd71837_clk_probe(struct platform_device *pdev)
119122
dev_err(&pdev->dev, "Unknown clk chip\n");
120123
return -EINVAL;
121124
}
122-
c->mfd = mfd;
123125
c->pdev = pdev;
124126
c->hw.init = &init;
125127

0 commit comments

Comments
 (0)