From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] NET: mv643xx: Get clk from device tree.
Date: Sat, 26 Jan 2013 16:10:28 +0100 [thread overview]
Message-ID: <1359213030-18588-2-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1359213030-18588-1-git-send-email-andrew@lunn.ch>
If we are passed a device tree node pointer, get the clock from it.
This avoids problems with con_id when using clk_get().
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 7048d7c..296beec 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2955,7 +2955,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
*/
mp->t_clk = 133000000;
#if defined(CONFIG_HAVE_CLK)
- mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
+ if (pdev->dev.of_node)
+ mp->clk = of_clk_get(pdev->dev.of_node, 0);
+ else
+ mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
if (!IS_ERR(mp->clk)) {
clk_prepare_enable(mp->clk);
mp->t_clk = clk_get_rate(mp->clk);
--
1.7.10.4
next prev parent reply other threads:[~2013-01-26 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-26 15:10 [PATCH 0/3] Fixes and DT conversion for QNAP TS219 Andrew Lunn
2013-01-26 15:10 ` Andrew Lunn [this message]
2013-01-26 15:46 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Jason Cooper
2013-01-26 15:10 ` [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes Andrew Lunn
2013-01-26 19:59 ` Jason Cooper
2013-01-26 15:10 ` [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Andrew Lunn
2013-01-26 20:10 ` Jason Cooper
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=1359213030-18588-2-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).