[Accton][AS7946-30XB] Simplify CPLD access, drop unused hwmon, fix EEPROM size#209
Open
rayxhuangEC wants to merge 1 commit into
Open
[Accton][AS7946-30XB] Simplify CPLD access, drop unused hwmon, fix EEPROM size#209rayxhuangEC wants to merge 1 commit into
rayxhuangEC wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.