Commit 0f7e64a3 authored by David Daney's avatar David Daney Committed by Ralf Baechle

MIPS: Octeon: Add platform device for MDIO buses.

Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 362e6964
...@@ -159,6 +159,36 @@ static int __init octeon_rng_device_init(void) ...@@ -159,6 +159,36 @@ static int __init octeon_rng_device_init(void)
} }
device_initcall(octeon_rng_device_init); device_initcall(octeon_rng_device_init);
/* Octeon SMI/MDIO interface. */
static int __init octeon_mdiobus_device_init(void)
{
struct platform_device *pd;
int ret = 0;
if (octeon_is_simulation())
return 0; /* No mdio in the simulator. */
/* The bus number is the platform_device id. */
pd = platform_device_alloc("mdio-octeon", 0);
if (!pd) {
ret = -ENOMEM;
goto out;
}
ret = platform_device_add(pd);
if (ret)
goto fail;
return ret;
fail:
platform_device_put(pd);
out:
return ret;
}
device_initcall(octeon_mdiobus_device_init);
MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>"); MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Platform driver for Octeon SOC"); MODULE_DESCRIPTION("Platform driver for Octeon SOC");
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