Skip to content

[Accton][AS7946-30XB] Simplify CPLD access, drop unused hwmon, fix EEPROM size#209

Open
rayxhuangEC wants to merge 1 commit into
accton:support_linux_6.1from
rayxhuangEC:linux6.1-as7946-30xb
Open

[Accton][AS7946-30XB] Simplify CPLD access, drop unused hwmon, fix EEPROM size#209
rayxhuangEC wants to merge 1 commit into
accton:support_linux_6.1from
rayxhuangEC:linux6.1-as7946-30xb

Conversation

@rayxhuangEC

Copy link
Copy Markdown

cpld: as7946_30xb_cpld_read()/_write() dropped the bus_num parameter and the matching adapter->nr check. CPLD1 (0x61) and CPLD2 (0x62) are distinct addresses, so matching on cpld_addr alone is sufficient; all call sites now pass client->addr instead of hardcoded (bus, addr) pairs, removing the per-function switch(data->index) blocks.

This also fixes a latent bug in set_tx_disable(): the previous code read into 'val' but checked the stale 'status' variable for the read error, so a failed CPLD read was never detected there.

Removed the CPLD's hwmon registration (hwmon_device_register_with_info, as7946_30xb_cpld_chip_info/_ops/_is_visible) since is_visible always returned 0, meaning the hwmon device never exposed any attributes.

sys: fix EEPROM_SIZE (512 -> 256) to match the actual system EEPROM size.

…PROM size

cpld: as7946_30xb_cpld_read()/_write() dropped the bus_num parameter
and the matching adapter->nr check. CPLD1 (0x61) and CPLD2 (0x62) are
distinct addresses, so matching on cpld_addr alone is sufficient; all
call sites now pass client->addr instead of hardcoded (bus, addr)
pairs, removing the per-function switch(data->index) blocks.

This also fixes a latent bug in set_tx_disable(): the previous code
read into 'val' but checked the stale 'status' variable for the read
error, so a failed CPLD read was never detected there.

Removed the CPLD's hwmon registration (hwmon_device_register_with_info,
as7946_30xb_cpld_chip_info/_ops/_is_visible) since is_visible always
returned 0, meaning the hwmon device never exposed any attributes.

sys: fix EEPROM_SIZE (512 -> 256) to match the actual system EEPROM
size.

Signed-off-by: rayx_huang <rayx_huang@edge-core.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant