Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224515
b: refs/heads/master
c: e0f4258
h: refs/heads/master
i:
  224513: 391f9f9
  224511: 44fef57
v: v3
  • Loading branch information
Jonas Bonn authored and David S. Miller committed Nov 28, 2010
1 parent 70de4b7 commit 2335cc0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 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: 3f0a069a1d5c0ccace735e3a62c1bcef53e4c354
refs/heads/master: e0f4258be2515afce8ef1e6fb22312525c281798
32 changes: 30 additions & 2 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <net/ethoc.h>

static int buffer_size = 0x8000; /* 32 KBytes */
Expand Down Expand Up @@ -982,10 +983,23 @@ static int __devinit ethoc_probe(struct platform_device *pdev)

/* Allow the platform setup code to pass in a MAC address. */
if (pdev->dev.platform_data) {
struct ethoc_platform_data *pdata =
(struct ethoc_platform_data *)pdev->dev.platform_data;
struct ethoc_platform_data *pdata = pdev->dev.platform_data;
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
priv->phy_id = pdata->phy_id;
} else {
priv->phy_id = -1;

#ifdef CONFIG_OF
{
const uint8_t* mac;

mac = of_get_property(pdev->dev.of_node,
"local-mac-address",
NULL);
if (mac)
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
}
#endif
}

/* Check that the given MAC address is valid. If it isn't, read the
Expand Down Expand Up @@ -1113,13 +1127,27 @@ static int ethoc_resume(struct platform_device *pdev)
# define ethoc_resume NULL
#endif

#ifdef CONFIG_OF
static struct of_device_id ethoc_match[] = {
{
.compatible = "opencores,ethoc",
},
{},
};
MODULE_DEVICE_TABLE(of, ethoc_match);
#endif

static struct platform_driver ethoc_driver = {
.probe = ethoc_probe,
.remove = __devexit_p(ethoc_remove),
.suspend = ethoc_suspend,
.resume = ethoc_resume,
.driver = {
.name = "ethoc",
.owner = THIS_MODULE,
#ifdef CONFIG_OF
.of_match_table = ethoc_match,
#endif
},
};

Expand Down

0 comments on commit 2335cc0

Please sign in to comment.