Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369206
b: refs/heads/master
c: 2092248
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Hesselbarth authored and David S. Miller committed Apr 11, 2013
1 parent 63dd173 commit ea2374c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8075daf552b37b668618f47d15ce2e2e7a1b258
refs/heads/master: 209224862cabf7a871d680c448148ef6376bf98b
3 changes: 3 additions & 0 deletions trunk/Documentation/devicetree/bindings/marvell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd.
- compatible : "marvell,mv64360-eth-block"
- reg : Offset and length of the register set for this block

Optional properties:
- clocks : Phandle to the clock control device and gate bit

Example Discovery Ethernet block node:
ethernet-block@2000 {
#address-cells = <1>;
Expand Down
27 changes: 11 additions & 16 deletions trunk/drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ struct mv643xx_eth_shared_private {
int extended_rx_coal_limit;
int tx_bw_control;
int tx_csum_limit;

struct clk *clk;
};

#define TX_BW_CONTROL_ABSENT 0
Expand Down Expand Up @@ -410,9 +410,7 @@ struct mv643xx_eth_private {
/*
* Hardware-specific parameters.
*/
#if defined(CONFIG_HAVE_CLK)
struct clk *clk;
#endif
unsigned int t_clk;
};

Expand Down Expand Up @@ -2569,6 +2567,10 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
if (msp->base == NULL)
goto out_free;

msp->clk = devm_clk_get(&pdev->dev, NULL);
if (!IS_ERR(msp->clk))
clk_prepare_enable(msp->clk);

/*
* (Re-)program MBUS remapping windows if we are asked to.
*/
Expand All @@ -2595,6 +2597,8 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
struct mv643xx_eth_shared_private *msp = platform_get_drvdata(pdev);

iounmap(msp->base);
if (!IS_ERR(msp->clk))
clk_disable_unprepare(msp->clk);
kfree(msp);

return 0;
Expand Down Expand Up @@ -2801,13 +2805,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
* it to override the default.
*/
mp->t_clk = 133000000;
#if defined(CONFIG_HAVE_CLK)
mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
mp->clk = devm_clk_get(&pdev->dev, NULL);
if (!IS_ERR(mp->clk)) {
clk_prepare_enable(mp->clk);
mp->t_clk = clk_get_rate(mp->clk);
}
#endif

set_params(mp, pd);
netif_set_real_num_tx_queues(dev, mp->txq_count);
netif_set_real_num_rx_queues(dev, mp->rxq_count);
Expand Down Expand Up @@ -2889,12 +2892,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
return 0;

out:
#if defined(CONFIG_HAVE_CLK)
if (!IS_ERR(mp->clk)) {
if (!IS_ERR(mp->clk))
clk_disable_unprepare(mp->clk);
clk_put(mp->clk);
}
#endif
free_netdev(dev);

return err;
Expand All @@ -2909,12 +2908,8 @@ static int mv643xx_eth_remove(struct platform_device *pdev)
phy_detach(mp->phy);
cancel_work_sync(&mp->tx_timeout_task);

#if defined(CONFIG_HAVE_CLK)
if (!IS_ERR(mp->clk)) {
if (!IS_ERR(mp->clk))
clk_disable_unprepare(mp->clk);
clk_put(mp->clk);
}
#endif

free_netdev(mp->dev);

Expand Down

0 comments on commit ea2374c

Please sign in to comment.