diff options
author | David Daney <ddaney@caviumnetworks.com> | 2009-10-14 15:04:37 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-12-16 20:56:58 -0500 |
commit | 0f7e64a3941fef0a5735da5184f3ccc0d234b580 (patch) | |
tree | 456e42f477bfad13b1de86bae39d0b2d52aff0cd /arch/mips/cavium-octeon/octeon-platform.c | |
parent | 362e696428590f7d0a5d0971a2d04b0372a761b8 (diff) |
MIPS: Octeon: Add platform device for MDIO buses.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon/octeon-platform.c')
-rw-r--r-- | arch/mips/cavium-octeon/octeon-platform.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index be711dd2d918..febfdd73309f 100644 --- a/arch/mips/cavium-octeon/octeon-platform.c +++ b/arch/mips/cavium-octeon/octeon-platform.c | |||
@@ -159,6 +159,36 @@ out: | |||
159 | } | 159 | } |
160 | device_initcall(octeon_rng_device_init); | 160 | device_initcall(octeon_rng_device_init); |
161 | 161 | ||
162 | /* Octeon SMI/MDIO interface. */ | ||
163 | static int __init octeon_mdiobus_device_init(void) | ||
164 | { | ||
165 | struct platform_device *pd; | ||
166 | int ret = 0; | ||
167 | |||
168 | if (octeon_is_simulation()) | ||
169 | return 0; /* No mdio in the simulator. */ | ||
170 | |||
171 | /* The bus number is the platform_device id. */ | ||
172 | pd = platform_device_alloc("mdio-octeon", 0); | ||
173 | if (!pd) { | ||
174 | ret = -ENOMEM; | ||
175 | goto out; | ||
176 | } | ||
177 | |||
178 | ret = platform_device_add(pd); | ||
179 | if (ret) | ||
180 | goto fail; | ||
181 | |||
182 | return ret; | ||
183 | fail: | ||
184 | platform_device_put(pd); | ||
185 | |||
186 | out: | ||
187 | return ret; | ||
188 | |||
189 | } | ||
190 | device_initcall(octeon_mdiobus_device_init); | ||
191 | |||
162 | MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>"); | 192 | MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>"); |
163 | MODULE_LICENSE("GPL"); | 193 | MODULE_LICENSE("GPL"); |
164 | MODULE_DESCRIPTION("Platform driver for Octeon SOC"); | 194 | MODULE_DESCRIPTION("Platform driver for Octeon SOC"); |