aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpts.c
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@ti.com>2014-05-02 02:32:00 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-05 13:18:50 -0400
commitd0415e7cc092b2f77028895b65195210b4ad4dc6 (patch)
tree1d3c0850531e82ee5510f8351be28f5d90866141 /drivers/net/ethernet/ti/cpts.c
parent0987a6ef94238097a380aa5e8a69a74393baa5be (diff)
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: George Cherian <george.cherian@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpts.c')
-rw-r--r--drivers/net/ethernet/ti/cpts.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index 243513980b51..6b56f85951e5 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -236,13 +236,11 @@ static void cpts_overflow_check(struct work_struct *work)
236 schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD); 236 schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD);
237} 237}
238 238
239#define CPTS_REF_CLOCK_NAME "cpsw_cpts_rft_clk" 239static void cpts_clk_init(struct device *dev, struct cpts *cpts)
240
241static void cpts_clk_init(struct cpts *cpts)
242{ 240{
243 cpts->refclk = clk_get(NULL, CPTS_REF_CLOCK_NAME); 241 cpts->refclk = devm_clk_get(dev, "cpts");
244 if (IS_ERR(cpts->refclk)) { 242 if (IS_ERR(cpts->refclk)) {
245 pr_err("Failed to clk_get %s\n", CPTS_REF_CLOCK_NAME); 243 dev_err(dev, "Failed to get cpts refclk\n");
246 cpts->refclk = NULL; 244 cpts->refclk = NULL;
247 return; 245 return;
248 } 246 }
@@ -252,7 +250,6 @@ static void cpts_clk_init(struct cpts *cpts)
252static void cpts_clk_release(struct cpts *cpts) 250static void cpts_clk_release(struct cpts *cpts)
253{ 251{
254 clk_disable(cpts->refclk); 252 clk_disable(cpts->refclk);
255 clk_put(cpts->refclk);
256} 253}
257 254
258static int cpts_match(struct sk_buff *skb, unsigned int ptp_class, 255static 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 for (i = 0; i < CPTS_MAX_EVENTS; i++) 387 for (i = 0; i < CPTS_MAX_EVENTS; i++)
391 list_add(&cpts->pool_data[i].list, &cpts->pool); 388 list_add(&cpts->pool_data[i].list, &cpts->pool);
392 389
393 cpts_clk_init(cpts); 390 cpts_clk_init(dev, cpts);
394 cpts_write32(cpts, CPTS_EN, control); 391 cpts_write32(cpts, CPTS_EN, control);
395 cpts_write32(cpts, TS_PEND_EN, int_enable); 392 cpts_write32(cpts, TS_PEND_EN, int_enable);
396 393