diff options
author | John Crispin <blogic@openwrt.org> | 2012-12-15 01:59:08 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-12-15 01:59:08 +0000 |
commit | 7d0cb0b8f09e73151616e675f8e80d8c3bb3f18b (patch) | |
tree | 6ef2bbb8950081d14ea6b0e20c802c9eeaf3aee9 /target/linux/generic/files/drivers/net/phy/rtl8366s.c | |
parent | af0c735653111e0a182eb87a7d81924d08bdc187 (diff) | |
download | upstream-7d0cb0b8f09e73151616e675f8e80d8c3bb3f18b.tar.gz upstream-7d0cb0b8f09e73151616e675f8e80d8c3bb3f18b.tar.bz2 upstream-7d0cb0b8f09e73151616e675f8e80d8c3bb3f18b.zip |
[kernel] make rtl8366 driver OF capable
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34682 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/rtl8366s.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366s.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 77427d6c9e..6e5e48749b 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -12,7 +12,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/platform_device.h> +#include <linux/of_platform.h> #include <linux/delay.h> #include <linux/skbuff.h> #include <linux/rtl8366.h> @@ -1059,22 +1059,9 @@ static int __devinit rtl8366s_probe(struct platform_device *pdev) printk(KERN_NOTICE RTL8366S_DRIVER_DESC " version " RTL8366S_DRIVER_VER"\n"); - pdata = pdev->dev.platform_data; - if (!pdata) { - dev_err(&pdev->dev, "no platform data specified\n"); - err = -EINVAL; - goto err_out; - } - - smi = rtl8366_smi_alloc(&pdev->dev); - if (!smi) { - err = -ENOMEM; - goto err_out; - } - - smi->gpio_sda = pdata->gpio_sda; - smi->gpio_sck = pdata->gpio_sck; - smi->hw_reset = pdata->hw_reset; + smi = rtl8366_smi_probe(pdev); + if (!smi) + return -ENODEV; smi->clk_delay = 10; smi->cmd_read = 0xa9; @@ -1121,10 +1108,19 @@ static int __devexit rtl8366s_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id rtl8366s_match[] = { + { .compatible = "rtl8366s" }, + {}, +}; +MODULE_DEVICE_TABLE(of, rtl8366s_match); +#endif + static struct platform_driver rtl8366s_driver = { .driver = { .name = RTL8366S_DRIVER_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(rtl8366s_match), }, .probe = rtl8366s_probe, .remove = __devexit_p(rtl8366s_remove), |