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;
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);
static struct rtl8366_smi_ops rtl8366rb_smi_ops = {
.detect = rtl8366rb_detect,
+ .setup = rtl8366rb_setup,
+
.mii_read = rtl8366rb_mii_read,
.mii_write = rtl8366rb_mii_write,
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;
static struct rtl8366_smi_ops rtl8366s_smi_ops = {
.detect = rtl8366s_detect,
+ .setup = rtl8366s_setup,
+
.mii_read = rtl8366s_mii_read,
.mii_write = rtl8366s_mii_write,
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;