Currently, the CMU is configured after media specific settings have been
set. This seems to work however does not make that much sense. The
proper clock should be configured before the TX/RX channels are
configured. Thus, move the call to the CMU configuration above the media
handling.
While at it, handle the return code of the CMU config properly.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
if (ret < 0)
return ret;
+ ret = rtpcs_931x_sds_config_cmu(sds, hw_mode);
+ if (ret < 0)
+ return ret;
+
switch (hw_mode) {
case RTPCS_SDS_MODE_OFF:
ret = rtpcs_931x_sds_set_port_media(sds, RTPCS_PORT_MEDIA_NONE);
break;
}
- rtpcs_931x_sds_config_cmu(sds, hw_mode);
-
if (sds_id >= 2) {
if (ctrl->chip_version == RTPCS_CHIP_V2)
/* consider 9311 etc. RTL9313_CHIP_ID == HWP_CHIP_ID(unit)) */