diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-07-15 13:05:21 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-07-15 13:05:21 +0000 |
commit | 23ba874c9c185260437abf5b38ffa702685c08ad (patch) | |
tree | ebbf411e48afd337e5b813d7fd9cc1d72e58a7a0 /target/linux | |
parent | 6ccacc5e4f961ca89bd6cc011ef6c29ae1962efa (diff) | |
download | upstream-23ba874c9c185260437abf5b38ffa702685c08ad.tar.gz upstream-23ba874c9c185260437abf5b38ffa702685c08ad.tar.bz2 upstream-23ba874c9c185260437abf5b38ffa702685c08ad.zip |
generic: rtl8366: add setup to rtl8366_smi_ops struct
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22196 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
4 files changed, 11 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index ac8862ced6..c7e03901db 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -790,6 +790,12 @@ int rtl8366_smi_init(struct rtl8366_smi *smi) goto err_free_sck; } + err = smi->ops->setup(smi); + if (err) { + dev_err(smi->parent, "chip setup failed, err=%d\n", err); + goto err_free_sck; + } + err = rtl8366_smi_mii_init(smi); if (err) goto err_free_sck; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h index 775f95935e..86517c97ce 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h @@ -69,6 +69,7 @@ struct rtl8366_vlan_4k { struct rtl8366_smi_ops { int (*detect)(struct rtl8366_smi *smi); + int (*setup)(struct rtl8366_smi *smi); int (*mii_read)(struct mii_bus *bus, int addr, int reg); int (*mii_write)(struct mii_bus *bus, int addr, int reg, u16 val); diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index aa0b4a0b71..984f3861f7 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -1103,6 +1103,8 @@ static int rtl8366rb_detect(struct rtl8366_smi *smi) static struct rtl8366_smi_ops rtl8366rb_smi_ops = { .detect = rtl8366rb_detect, + .setup = rtl8366rb_setup, + .mii_read = rtl8366rb_mii_read, .mii_write = rtl8366rb_mii_write, @@ -1154,10 +1156,6 @@ static int __init rtl8366rb_probe(struct platform_device *pdev) platform_set_drvdata(pdev, smi); - err = rtl8366rb_setup(smi); - if (err) - goto err_clear_drvdata; - err = rtl8366rb_switch_init(smi); if (err) goto err_clear_drvdata; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 6f3fdd5092..34fd188595 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -1130,6 +1130,8 @@ static int rtl8366s_detect(struct rtl8366_smi *smi) static struct rtl8366_smi_ops rtl8366s_smi_ops = { .detect = rtl8366s_detect, + .setup = rtl8366s_setup, + .mii_read = rtl8366s_mii_read, .mii_write = rtl8366s_mii_write, @@ -1181,10 +1183,6 @@ static int __init rtl8366s_probe(struct platform_device *pdev) platform_set_drvdata(pdev, smi); - err = rtl8366s_setup(smi); - if (err) - goto err_clear_drvdata; - err = rtl8366s_switch_init(smi); if (err) goto err_clear_drvdata; |