Skip to content

Commit

Permalink
clk: cdce706: Use managed of_clk_add_hw_provider()
Browse files Browse the repository at this point in the history
Use the managed `devm_of_clk_add_hw_provider()` instead of
`of_clk_add_hw_provider()`.

This makes sure the provider gets automatically removed on unbind and
allows to completely eliminate the drivers `remove()` callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230410014502.27929-4-lars@metafoo.de
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Stephen Boyd committed Apr 10, 2023
1 parent 7bed704 commit c2e59c7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/clk/clk-cdce706.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,16 +661,10 @@ static int cdce706_probe(struct i2c_client *client)
ret = cdce706_register_clkouts(cdce);
if (ret < 0)
return ret;
return of_clk_add_hw_provider(client->dev.of_node, of_clk_cdce_get,
cdce);
return devm_of_clk_add_hw_provider(&client->dev, of_clk_cdce_get,
cdce);
}

static void cdce706_remove(struct i2c_client *client)
{
of_clk_del_provider(client->dev.of_node);
}


#ifdef CONFIG_OF
static const struct of_device_id cdce706_dt_match[] = {
{ .compatible = "ti,cdce706" },
Expand All @@ -691,7 +685,6 @@ static struct i2c_driver cdce706_i2c_driver = {
.of_match_table = of_match_ptr(cdce706_dt_match),
},
.probe_new = cdce706_probe,
.remove = cdce706_remove,
.id_table = cdce706_id,
};
module_i2c_driver(cdce706_i2c_driver);
Expand Down

0 comments on commit c2e59c7

Please sign in to comment.