From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
linux-iio@vger.kernel.org, "Lars-Peter Clausen" <lars@metafoo.de>
Subject: [PATCH] iio: ad4310: Replace devm_clk_register() with devm_clk_hw_register()
Date: Sun, 26 Mar 2023 07:20:46 -0700 [thread overview]
Message-ID: <20230326142046.422314-1-lars@metafoo.de> (raw)
The devm_clk_register() is deprecated and devm_clk_hw_register() should be
used as a replacement.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/iio/adc/ad4130.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c
index 38394341fd6e..f23b7808e996 100644
--- a/drivers/iio/adc/ad4130.c
+++ b/drivers/iio/adc/ad4130.c
@@ -1823,7 +1823,7 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
struct device_node *of_node = dev_of_node(dev);
struct clk_init_data init;
const char *clk_name;
- struct clk *clk;
+ int ret;
if (st->int_pin_sel == AD4130_INT_PIN_CLK ||
st->mclk_sel != AD4130_MCLK_76_8KHZ)
@@ -1839,11 +1839,12 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
init.ops = &ad4130_int_clk_ops;
st->int_clk_hw.init = &init;
- clk = devm_clk_register(dev, &st->int_clk_hw);
- if (IS_ERR(clk))
- return PTR_ERR(clk);
+ ret = devm_clk_hw_register(dev, &st->int_clk_hw);
+ if (ret)
+ return ret;
- return of_clk_add_provider(of_node, of_clk_src_simple_get, clk);
+ return of_clk_add_hw_provider(of_node, of_clk_hw_simple_get,
+ &st->int_clk_hw);
}
static int ad4130_setup(struct iio_dev *indio_dev)
--
2.30.2
next reply other threads:[~2023-03-26 14:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-26 14:20 Lars-Peter Clausen [this message]
2023-03-26 15:25 ` [PATCH] iio: ad4310: Replace devm_clk_register() with devm_clk_hw_register() Jonathan Cameron
2023-04-09 18:25 ` Lars-Peter Clausen
2023-04-10 11:29 ` Jonathan Cameron
-- strict thread matches above, loose matches on Subject: below --
2023-09-10 14:09 Lars-Peter Clausen
2023-09-11 9:00 ` Nuno Sá
2023-09-13 19:14 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230326142046.422314-1-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=cosmin.tanislav@analog.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox