Commit d0415e7c authored by George Cherian's avatar George Cherian Committed by David S. Miller

drivers: net: cpts: Remove hardcoded clock name for CPTS

CPTS refclk name is hardcoded, which makes it fail in case of DRA7x
Remove the hardcoded clock name for CPTS refclk and get the same from DT.
Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0987a6ef
...@@ -236,13 +236,11 @@ static void cpts_overflow_check(struct work_struct *work) ...@@ -236,13 +236,11 @@ static void cpts_overflow_check(struct work_struct *work)
schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD); schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD);
} }
#define CPTS_REF_CLOCK_NAME "cpsw_cpts_rft_clk" static void cpts_clk_init(struct device *dev, struct cpts *cpts)
static void cpts_clk_init(struct cpts *cpts)
{ {
cpts->refclk = clk_get(NULL, CPTS_REF_CLOCK_NAME); cpts->refclk = devm_clk_get(dev, "cpts");
if (IS_ERR(cpts->refclk)) { if (IS_ERR(cpts->refclk)) {
pr_err("Failed to clk_get %s\n", CPTS_REF_CLOCK_NAME); dev_err(dev, "Failed to get cpts refclk\n");
cpts->refclk = NULL; cpts->refclk = NULL;
return; return;
} }
...@@ -252,7 +250,6 @@ static void cpts_clk_init(struct cpts *cpts) ...@@ -252,7 +250,6 @@ static void cpts_clk_init(struct cpts *cpts)
static void cpts_clk_release(struct cpts *cpts) static void cpts_clk_release(struct cpts *cpts)
{ {
clk_disable(cpts->refclk); clk_disable(cpts->refclk);
clk_put(cpts->refclk);
} }
static int cpts_match(struct sk_buff *skb, unsigned int ptp_class, static int cpts_match(struct sk_buff *skb, unsigned int ptp_class,
...@@ -390,7 +387,7 @@ int cpts_register(struct device *dev, struct cpts *cpts, ...@@ -390,7 +387,7 @@ int cpts_register(struct device *dev, struct cpts *cpts,
for (i = 0; i < CPTS_MAX_EVENTS; i++) for (i = 0; i < CPTS_MAX_EVENTS; i++)
list_add(&cpts->pool_data[i].list, &cpts->pool); list_add(&cpts->pool_data[i].list, &cpts->pool);
cpts_clk_init(cpts); cpts_clk_init(dev, cpts);
cpts_write32(cpts, CPTS_EN, control); cpts_write32(cpts, CPTS_EN, control);
cpts_write32(cpts, TS_PEND_EN, int_enable); cpts_write32(cpts, TS_PEND_EN, int_enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment