Counter fixes for 6.10

A fix to enable the TI eQEP clock explicitly in the probe callback
 rather than hope it's already enabled by something else on the system by
 the time we need it.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCZniZKwAKCRC1SFbKvhIj
 K9gnAQCARAZwZtuwgowiycAP14QbhpG6Rt7O9GYKJgp40ADLdwEAjMLXmQ9k+1kf
 p94RZJlWFH8PPeTSSGTjGM2bPQdlMgs=
 =tVH0
 -----END PGP SIGNATURE-----

Merge tag 'counter-fixes-for-6.10' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus

William writes:

Counter fixes for 6.10

A fix to enable the TI eQEP clock explicitly in the probe callback
rather than hope it's already enabled by something else on the system by
the time we need it.

* tag 'counter-fixes-for-6.10' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
  counter: ti-eqep: enable clock at probe
This commit is contained in:
Greg Kroah-Hartman 2024-06-24 12:59:56 +02:00
commit 06ebbce9c3

View File

@ -6,6 +6,7 @@
*/
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/counter.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
@ -376,6 +377,7 @@ static int ti_eqep_probe(struct platform_device *pdev)
struct counter_device *counter;
struct ti_eqep_cnt *priv;
void __iomem *base;
struct clk *clk;
int err;
counter = devm_counter_alloc(dev, sizeof(*priv));
@ -415,6 +417,10 @@ static int ti_eqep_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(clk))
return dev_err_probe(dev, PTR_ERR(clk), "failed to enable clock\n");
err = counter_add(counter);
if (err < 0) {
pm_runtime_put_sync(dev);