Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Edgecore][sonic-platform-modules-accton]Support kernel 6.1 and bookworm #16982

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/platform-modules-dell.mk
include $(PLATFORM_PATH)/platform-modules-arista.mk
#include $(PLATFORM_PATH)/platform-modules-ingrasys.mk
#include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/platform-modules-alphanetworks.mk
#include $(PLATFORM_PATH)/platform-modules-inventec.mk
include $(PLATFORM_PATH)/platform-modules-cel.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static int as4630_54pe_cpld_probe(struct i2c_client *client,
return ret;
}

static int as4630_54pe_cpld_remove(struct i2c_client *client)
static void as4630_54pe_cpld_remove(struct i2c_client *client)
{
struct as4630_54pe_cpld_data *data = i2c_get_clientdata(client);
const struct attribute_group *group = NULL;
Expand All @@ -794,7 +794,6 @@ static int as4630_54pe_cpld_remove(struct i2c_client *client)

kfree(data);

return 0;
}

static int as4630_54pe_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,14 @@ static int as4630_54pe_psu_probe(struct i2c_client *client,
return status;
}

static int as4630_54pe_psu_remove(struct i2c_client *client)
static void as4630_54pe_psu_remove(struct i2c_client *client)
{
struct as4630_54pe_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as4630_54pe_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ static int as4630_54te_cpld_probe(struct i2c_client *client,
return ret;
}

static int as4630_54te_cpld_remove(struct i2c_client *client)
static void as4630_54te_cpld_remove(struct i2c_client *client)
{
struct as4630_54te_cpld_data *data = i2c_get_clientdata(client);
const struct attribute_group *group = NULL;
Expand All @@ -797,7 +797,6 @@ static int as4630_54te_cpld_remove(struct i2c_client *client)

kfree(data);

return 0;
}

static int as4630_54te_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,14 @@ static int as4630_54te_psu_probe(struct i2c_client *client,
return status;
}

static int as4630_54te_psu_remove(struct i2c_client *client)
static void as4630_54te_psu_remove(struct i2c_client *client)
{
struct as4630_54te_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as4630_54te_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -153,7 +153,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -225,14 +225,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _get_thermal_node_val(self, thermal_num):
return None

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -109,13 +109,3 @@ def get_thermal_1_val(self):
def get_thermal_2_val(self):
return self._get_thermal_node_val(self.THERMAL_NUM_2_IDX)

#def main():
# thermal = ThermalUtil()
#
# print 'get_size_node_map : %d' % thermal.get_size_node_map()
# print 'get_size_path_map : %d' % thermal.get_size_path_map()
# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1):
# print thermal.get_thermal_to_device_path(x)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ static int as5712_54x_psu_probe(struct i2c_client *client,
return status;
}

static int as5712_54x_psu_remove(struct i2c_client *client)
static void as5712_54x_psu_remove(struct i2c_client *client)
{
struct as5712_54x_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5712_54x_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,14 @@ static int as5712_54x_sfp_probe(struct i2c_client *client,
return status;
}

static int as5712_54x_sfp_remove(struct i2c_client *client)
static void as5712_54x_sfp_remove(struct i2c_client *client)
{
struct as5712_54x_sfp_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5712_54x_sfp_group);
kfree(data);

return 0;
}

enum port_numbers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ static int as5712_54x_cpld_mux_probe(struct i2c_client *client,
return ret;
}

static int as5712_54x_cpld_mux_remove(struct i2c_client *client)
static void as5712_54x_cpld_mux_remove(struct i2c_client *client)
{
struct i2c_mux_core *muxc = i2c_get_clientdata(client);
struct as5712_54x_cpld_data *data = i2c_mux_priv(muxc);
Expand Down Expand Up @@ -1306,7 +1306,6 @@ static int as5712_54x_cpld_mux_remove(struct i2c_client *client)

i2c_mux_del_adapters(muxc);

return 0;
}

static int as5712_54x_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -166,7 +166,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -230,14 +230,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,21 @@ def _get_thermal_node_val(self, thermal_num):
self.logger.error('GET. unable to open file: %s', str(e))
return None

content = val_file.readline().rstrip()
content = val_file.readline().rstrip()

if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None
if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None

try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None

return int(content)
return int(content)

return 0


def get_num_thermals(self):
Expand All @@ -112,14 +114,3 @@ def get_thermal_1_val(self):

def get_thermal_2_val(self):
return self._get_thermal_node_val(self.THERMAL_NUM_2_IDX)

#def main():
# thermal = ThermalUtil()
#
# print 'get_size_node_map : %d' % thermal.get_size_node_map()
# print 'get_size_path_map : %d' % thermal.get_size_path_map()
# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1):
# print thermal.get_thermal_to_device_path(x)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static int as5812_54t_cpld_probe(struct i2c_client *client,
return status;
}

static int as5812_54t_cpld_remove(struct i2c_client *client)
static void as5812_54t_cpld_remove(struct i2c_client *client)
{
struct as5812_54t_cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -456,7 +456,6 @@ static int as5812_54t_cpld_remove(struct i2c_client *client)
kfree(data);
as5812_54t_cpld_remove_client(client);

return 0;
}

int as5812_54t_cpld_read(unsigned short cpld_addr, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,14 @@ static int as5812_54t_psu_probe(struct i2c_client *client,
return status;
}

static int as5812_54t_psu_remove(struct i2c_client *client)
static void as5812_54t_psu_remove(struct i2c_client *client)
{
struct as5812_54t_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5812_54t_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -166,7 +166,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -230,14 +230,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,23 @@ def _get_thermal_node_val(self, thermal_num):
self.logger.error('GET. unable to open file: %s', str(e))
return None

content = val_file.readline().rstrip()
content = val_file.readline().rstrip()

if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None
if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None

try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None

return int(content)
return int(content)

return 0


def get_num_thermals(self):
return self.THERMAL_NUM_ON_MAIN_BROAD

Expand All @@ -113,13 +115,3 @@ def get_thermal_1_val(self):
def get_thermal_2_val(self):
return self._get_thermal_node_val(self.THERMAL_NUM_2_IDX)

#def main():
# thermal = ThermalUtil()
#
# print 'get_size_node_map : %d' % thermal.get_size_node_map()
# print 'get_size_path_map : %d' % thermal.get_size_path_map()
# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1):
# print thermal.get_thermal_to_device_path(x)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ static int as5812_54x_psu_probe(struct i2c_client *client,
return status;
}

static int as5812_54x_psu_remove(struct i2c_client *client)
static void as5812_54x_psu_remove(struct i2c_client *client)
{
struct as5812_54x_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5812_54x_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Loading
Loading