Hi Pieter, > > void ksz9477_port_setup(struct ksz_device *dev, int port, bool > cpu_port) > { > + const u16 *regs = dev->info->regs; > struct dsa_switch *ds = dev->ds; > u16 data16; > u8 member; > @@ -1051,12 +1052,12 @@ void ksz9477_port_setup(struct ksz_device > *dev, int port, bool cpu_port) > ksz9477_port_acl_init(dev, port); > > /* clear pending wake flags */ > - ksz9477_handle_wake_reason(dev, port); > + ksz_handle_wake_reason(dev, port); > > /* Disable all WoL options by default. Otherwise > * ksz_switch_macaddr_get/put logic will not work properly. > */ > - ksz_pwrite8(dev, port, REG_PORT_PME_CTRL, 0); > + ksz_pwrite8(dev, port, regs[REG_PORT_PME_CTRL], 0); check the return value. > } > > void ksz9477_config_cpu_port(struct dsa_switch *ds) > @@ -1153,6 +1154,7 @@ int ksz9477_enable_stp_addr(struct ksz_device > *dev) > int ksz9477_setup(struct dsa_switch *ds) > { > struct ksz_device *dev = ds->priv; > + const u16 *regs = dev->info->regs; > int ret = 0; > > ds->mtu_enforcement_ingress = true; > @@ -1183,11 +1185,11 @@ int ksz9477_setup(struct dsa_switch *ds) > /* enable global MIB counter freeze function */ > ksz_cfg(dev, REG_SW_MAC_CTRL_6, SW_MIB_COUNTER_FREEZE, true); > > - /* Make sure PME (WoL) is not enabled. If requested, it will > be > - * enabled by ksz9477_wol_pre_shutdown(). Otherwise, some > PMICs do not > - * like PME events changes before shutdown. > + /* Make sure PME (WoL) is not enabled. If requested, it will > + * be enabled by ksz_wol_pre_shutdown(). Otherwise, some > PMICs > + * do not like PME events changes before shutdown. > */ > - ksz_write8(dev, REG_SW_PME_CTRL, 0); > + ksz_write8(dev, regs[REG_SW_PME_CTRL], 0); here also. > > return 0; > } > >