Skip to content

Commit

Permalink
Update code to support Bookworm
Browse files Browse the repository at this point in the history
* s6301-56st
* s7801-54xs
* s8901-54dc
* s9110-32x
* s9300-32d
  • Loading branch information
nonodark committed May 10, 2024
1 parent 9b337c4 commit 2b8a684
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 13 deletions.
3 changes: 1 addition & 2 deletions platform/broadcom/rules.dep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/sai.dep
# * Nokia
# * Juniper
# * Ragile
# * Ufispace
include $(PLATFORM_PATH)/platform-modules-s6000.dep
include $(PLATFORM_PATH)/platform-modules-dell.dep
include $(PLATFORM_PATH)/platform-modules-arista.dep
Expand All @@ -21,7 +20,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.dep
#include $(PLATFORM_PATH)/platform-modules-ragile.dep
include $(PLATFORM_PATH)/platform-modules-ruijie.dep
include $(PLATFORM_PATH)/platform-modules-brcm-xlr-gts.dep
#include $(PLATFORM_PATH)/platform-modules-ufispace.dep
include $(PLATFORM_PATH)/platform-modules-ufispace.dep
include $(PLATFORM_PATH)/docker-syncd-brcm.dep
include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.dep
include $(PLATFORM_PATH)/docker-saiserver-brcm.dep
Expand Down
3 changes: 1 addition & 2 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/sai.mk
# * Nokia
# * Juniper
# * Ragile
# * Ufispace
include $(PLATFORM_PATH)/platform-modules-nokia.mk
include $(PLATFORM_PATH)/platform-modules-dell.mk
include $(PLATFORM_PATH)/platform-modules-arista.mk
Expand All @@ -21,7 +20,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.mk
#include $(PLATFORM_PATH)/platform-modules-ruijie.mk
#include $(PLATFORM_PATH)/platform-modules-ragile.mk
#include $(PLATFORM_PATH)/platform-modules-tencent.mk
#include $(PLATFORM_PATH)/platform-modules-ufispace.mk
include $(PLATFORM_PATH)/platform-modules-ufispace.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk
include $(PLATFORM_PATH)/docker-saiserver-brcm.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/version.h>

#define _memset(s, c, n) memset(s, c, n)

Expand Down Expand Up @@ -242,12 +243,19 @@ static int sys_eeprom_probe(struct i2c_client *client,
return err;
}

static int sys_eeprom_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
sys_eeprom_remove(struct i2c_client *client)
{
sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr);
kfree(i2c_get_clientdata(client));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static const struct i2c_device_id sys_eeprom_id[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/version.h>
#include "x86-64-ufispace-s7801-54xs-cpld.h"

#ifdef DEBUG
Expand Down Expand Up @@ -1332,7 +1333,12 @@ static int cpld_probe(struct i2c_client *client,
}

/* cpld drvier remove */
static int cpld_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
cpld_remove(struct i2c_client *client)
{
struct cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -1346,7 +1352,9 @@ static int cpld_remove(struct i2c_client *client)
}

cpld_remove_client(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static int s7801_54xs_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/version.h>

#define _memset(s, c, n) memset(s, c, n)

Expand Down Expand Up @@ -241,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client,
return err;
}

static int sys_eeprom_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
sys_eeprom_remove(struct i2c_client *client)
{
sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr);
kfree(i2c_get_clientdata(client));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static const struct i2c_device_id sys_eeprom_id[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/version.h>
#include "x86-64-ufispace-s8901-54xc-cpld.h"

#ifdef DEBUG
Expand Down Expand Up @@ -1332,7 +1333,12 @@ static int cpld_probe(struct i2c_client *client,
}

/* cpld drvier remove */
static int cpld_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
cpld_remove(struct i2c_client *client)
{
struct cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -1346,7 +1352,9 @@ static int cpld_remove(struct i2c_client *client)
}

cpld_remove_client(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static int s8901_54xc_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/version.h>

#define _memset(s, c, n) memset(s, c, n)

Expand Down Expand Up @@ -241,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client,
return err;
}

static int sys_eeprom_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
sys_eeprom_remove(struct i2c_client *client)
{
sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr);
kfree(i2c_get_clientdata(client));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static const struct i2c_device_id sys_eeprom_id[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/version.h>
#include "x86-64-ufispace-s9110-32x-cpld.h"

#if !defined(SENSOR_DEVICE_ATTR_RO)
Expand Down Expand Up @@ -1315,7 +1316,12 @@ static int cpld_probe(struct i2c_client *client,
}

/* cpld drvier remove */
static int cpld_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
cpld_remove(struct i2c_client *client)
{
struct cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -1329,7 +1335,9 @@ static int cpld_remove(struct i2c_client *client)
}

cpld_remove_client(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

#if 0 /* FIXME */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/version.h>

#define _memset(s, c, n) memset(s, c, n)

Expand Down Expand Up @@ -241,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client,
return err;
}

static int sys_eeprom_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
sys_eeprom_remove(struct i2c_client *client)
{
sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr);
kfree(i2c_get_clientdata(client));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static const struct i2c_device_id sys_eeprom_id[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/version.h>
#include "x86-64-ufispace-s9300-32d-cpld.h"

#ifdef DEBUG
Expand Down Expand Up @@ -1527,7 +1528,12 @@ static int s9300_cpld_probe(struct i2c_client *client,
}

/* cpld drvier remove */
static int s9300_cpld_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
s9300_cpld_remove(struct i2c_client *client)
{
struct cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -1544,7 +1550,9 @@ static int s9300_cpld_remove(struct i2c_client *client)
}

s9300_cpld_remove_client(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

MODULE_DEVICE_TABLE(i2c, s9300_cpld_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/version.h>

#define _memset(s, c, n) memset(s, c, n)

Expand Down Expand Up @@ -242,12 +243,19 @@ static int sys_eeprom_probe(struct i2c_client *client,
return err;
}

static int sys_eeprom_remove(struct i2c_client *client)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int
#else
static void
#endif
sys_eeprom_remove(struct i2c_client *client)
{
sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr);
kfree(i2c_get_clientdata(client));

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
#endif
}

static const struct i2c_device_id sys_eeprom_id[] = {
Expand Down

0 comments on commit 2b8a684

Please sign in to comment.