Skip to content
Open
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.dep
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include $(PLATFORM_PATH)/platform-modules-cel.dep
#include $(PLATFORM_PATH)/platform-modules-ragile.dep
include $(PLATFORM_PATH)/platform-modules-supermicro.dep
include $(PLATFORM_PATH)/platform-modules-ufispace.dep
#include $(PLATFORM_PATH)/platform-modules-micas.dep
include $(PLATFORM_PATH)/platform-modules-micas.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
2 changes: 1 addition & 1 deletion platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include $(PLATFORM_PATH)/platform-modules-cel.mk
include $(PLATFORM_PATH)/platform-modules-supermicro.mk
#include $(PLATFORM_PATH)/platform-modules-tencent.mk
include $(PLATFORM_PATH)/platform-modules-ufispace.mk
#include $(PLATFORM_PATH)/platform-modules-micas.mk
include $(PLATFORM_PATH)/platform-modules-micas.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 @@ -226,7 +226,7 @@ static struct i2c_driver ct7318_driver = {
.name = "ct7318",
.of_match_table = of_match_ptr(ct7318_of_match),
},
.probe_new = ct7318_probe,
.probe = ct7318_probe,
.id_table = ct7318_id,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

#include "hw_test.h"

extern struct bus_type mdio_bus_type;
extern const struct bus_type mdio_bus_type;

struct board_mdio_dev {
struct list_head list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static int dfd_ko_cfg_add_str_item(int key, char *str, int line_num)
return -1;
}
mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN);
strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
strscpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);

rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, str_cfg);
if (rv == 0) {
Expand All @@ -260,7 +260,7 @@ static int dfd_ko_cfg_add_str_item(int key, char *str, int line_num)
} else {
DBG_DEBUG(DBG_WARN, "line%d: replace string item[%s->%s], key=0x%08x\n", line_num, str_cfg, str, key);
mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN);
strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
strscpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
}

return 0;
Expand Down Expand Up @@ -454,7 +454,7 @@ static void dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_t *info_ctrl, info_ctrl
break;
case INFO_CTRL_MEM_FPATH:
mem_clear(info_ctrl->fpath, sizeof(info_ctrl->fpath));
strlcpy(info_ctrl->fpath, buf_val, sizeof(info_ctrl->fpath));
strscpy(info_ctrl->fpath, buf_val, sizeof(info_ctrl->fpath));
break;
case INFO_CTRL_MEM_ADDR:
dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->addr), line_num);
Expand All @@ -467,7 +467,7 @@ static void dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_t *info_ctrl, info_ctrl
break;
case INFO_CTRL_MEM_STR_CONS:
mem_clear(info_ctrl->str_cons, sizeof(info_ctrl->str_cons));
strlcpy(info_ctrl->str_cons, buf_val, sizeof(info_ctrl->str_cons));
strscpy(info_ctrl->str_cons, buf_val, sizeof(info_ctrl->str_cons));
break;
case INFO_CTRL_MEM_INT_EXTRA1:
dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_extra1), line_num);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void dfd_ko_cfg_regval_conv_lst_add(struct list_head *root, int val, char
val_convert->index1 = index1;
val_convert->index2 = index2;
if (str != NULL) {
strlcpy(val_convert->str_val, str, sizeof(val_convert->str_val));
strscpy(val_convert->str_val, str, sizeof(val_convert->str_val));
}

/* After initialization, the list does not change and does not need to be locked */
Expand Down Expand Up @@ -517,7 +517,7 @@ static int dfd_ko_cfg_add_str_item(uint64_t key, char *str, int line_num)
return -1;
}
mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN);
strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
strscpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);

/* Add to linked list */
rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, str_cfg);
Expand All @@ -535,7 +535,7 @@ static int dfd_ko_cfg_add_str_item(uint64_t key, char *str, int line_num)
DBG_DEBUG(DBG_WARN, "line%d: replace string item[%s->%s], key=0x%08llx\n",
line_num, str_cfg, str, key);
mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN);
strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
strscpy(str_cfg, str, DFD_CFG_STR_MAX_LEN);
}

return 0;
Expand Down Expand Up @@ -748,7 +748,7 @@ static void dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_t *info_ctrl, info_ctrl
break;
case INFO_CTRL_MEM_FPATH:
mem_clear(info_ctrl->fpath, sizeof(info_ctrl->fpath));
strlcpy(info_ctrl->fpath, buf_val, sizeof(info_ctrl->fpath));
strscpy(info_ctrl->fpath, buf_val, sizeof(info_ctrl->fpath));
break;
case INFO_CTRL_MEM_ADDR:
dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->addr), line_num);
Expand All @@ -761,7 +761,7 @@ static void dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_t *info_ctrl, info_ctrl
break;
case INFO_CTRL_MEM_STR_CONS:
mem_clear(info_ctrl->str_cons, sizeof(info_ctrl->str_cons));
strlcpy(info_ctrl->str_cons, buf_val, sizeof(info_ctrl->str_cons));
strscpy(info_ctrl->str_cons, buf_val, sizeof(info_ctrl->str_cons));
break;
case INFO_CTRL_MEM_INT_EXTRA1:
dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_extra1), line_num);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static int dfd_fan_product_name_decode(char *fan_buf, int buf_len)
return -DFD_RV_DEV_NOTSUPPORT;
}
mem_clear(fan_buf, buf_len);
strlcpy(fan_buf, p_decode_name, buf_len);
strscpy(fan_buf, p_decode_name, buf_len);
DFD_FAN_DEBUG(DBG_VERBOSE, "fan name match ok, display fan name: %s.\n", fan_buf);
return DFD_RV_OK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static int dfd_get_psu_fan_speed_cal_str(int power_type, char *psu_buf, int buf_
return -DFD_RV_DEV_NOTSUPPORT;
}
mem_clear(psu_buf, buf_len);
strlcpy(psu_buf, speed_cal, buf_len);
strscpy(psu_buf, speed_cal, buf_len);
DFD_PSU_DEBUG(DBG_VERBOSE, "psu speed cal match ok, speed_cal: %s\n", psu_buf);
return DFD_RV_OK;
}
Expand Down Expand Up @@ -421,7 +421,7 @@ static int dfd_psu_product_name_decode(int power_type, char *psu_buf, int buf_le
return -DFD_RV_DEV_NOTSUPPORT;
}
mem_clear(psu_buf, buf_len);
strlcpy(psu_buf, p_decode_name, buf_len);
strscpy(psu_buf, p_decode_name, buf_len);
DFD_PSU_DEBUG(DBG_VERBOSE, "psu name match ok, display psu name: %s\n", psu_buf);
return DFD_RV_OK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static struct i2c_driver pmbus_driver = {
.driver = {
.name = "wb_pmbus",
},
.probe_new = pmbus_probe,
.probe = pmbus_probe,
.id_table = pmbus_id,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,13 @@ static int fpga_i2c_probe(struct platform_device *pdev)
return ret;
};

static int fpga_i2c_remove(struct platform_device *pdev)
static void fpga_i2c_remove(struct platform_device *pdev)
{
fpga_i2c_dev_t *fpga_i2c;

fpga_i2c = platform_get_drvdata(pdev);
i2c_del_adapter(&fpga_i2c->adap);
platform_set_drvdata(pdev, NULL);
return 0;
};

static struct of_device_id fpga_i2c_match[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan)
/*
* I2C init/probing/exit functions
*/
static int fpga_i2c_pca954x_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int fpga_i2c_pca954x_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
int num, force, class;
Expand All @@ -381,6 +381,7 @@ static int fpga_i2c_pca954x_probe(struct i2c_client *client, const struct i2c_de
struct device *dev;
int dynamic_nr = 1;
fpga_pca954x_device_t *fpga_pca954x_device;
const struct i2c_device_id *id = i2c_match_id(fpga_pca954x_id, client);

#if LINUX_VERSION_CODE > KERNEL_VERSION(4,6,7)
struct i2c_mux_core *muxc;
Expand Down Expand Up @@ -486,7 +487,7 @@ static int fpga_i2c_pca954x_probe(struct i2c_client *client, const struct i2c_de
goto virt_reg_failed;
}
#else
ret = i2c_mux_add_adapter(muxc, force, num, class);
ret = i2c_mux_add_adapter(muxc, force, num);
if (ret) {
dev_err(&client->dev, "Failed to register multiplexed adapter %d as bus %d\n",
num, force);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include <linux/of.h>
#include <linux/io.h>
#include <linux/errno.h>
#include <linux/ioport.h>
Expand Down Expand Up @@ -351,10 +353,9 @@ static int wb_gpio_probe(struct platform_device *pdev)
return 0;
}

static int wb_gpio_remove(struct platform_device *pdev)
static void wb_gpio_remove(struct platform_device *pdev)
{
dev_info(&pdev->dev, "unregister d1500 gpio success\n");
return 0;
}

static const struct of_device_id gpio_d1500_match[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
Expand Down Expand Up @@ -741,7 +742,7 @@ int i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_
}
EXPORT_SYMBOL(i2c_device_func_write);

static int i2c_dev_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int i2c_dev_probe(struct i2c_client *client)
{
int ret = 0;
struct i2c_dev_info *i2c_dev;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,20 +656,20 @@ static int pca954x_do_gpio_reset(struct i2c_mux_core *muxc)
}

/* reset on */
__gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on);
gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on);

if (reset_cfg->rst_delay) {
usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1);
}

/* reset off */
__gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off);
gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off);
ret = -1;
udelay_cnt = 0;
timeout = reset_cfg->rst_delay_a;
while (timeout > 0) {
usleep_range(1, 2);
val = __gpio_get_value(gpio_attr->gpio);
val = gpio_get_value(gpio_attr->gpio);
if (val == gpio_attr->reset_off) {
ret = 0;
PCA954X_DEBUG("pca954x_do_gpio_reset success.\n");
Expand Down Expand Up @@ -1186,8 +1186,7 @@ static int pca954x_reset_data_init(struct pca954x *data)
/*
* I2C init/probing/exit functions
*/
static int pca954x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int pca954x_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent);
struct device_node *of_node = client->dev.of_node;
Expand All @@ -1200,6 +1199,7 @@ static int pca954x_probe(struct i2c_client *client,
unsigned int probe_disable;
int ret, dynamic_nr;
i2c_mux_pca954x_device_t *i2c_mux_pca954x_device;
const struct i2c_device_id *id = i2c_match_id(pca954x_id, client);

PCA954X_DEBUG("pca954x_probe, parent bus: %d, 9548 addr:0x%x.\n", adap->nr, client->addr);

Expand Down Expand Up @@ -1313,11 +1313,10 @@ static int pca954x_probe(struct i2c_client *client,
force = data->pca9548_cfg_info.pca9548_base_nr + num;
}

class = 0; /* no class by default */
data->deselect |= (idle_disconnect_pd ||
idle_disconnect_dt) << num;

ret = i2c_mux_add_adapter(muxc, force, num, class);
ret = i2c_mux_add_adapter(muxc, force, num);
if (ret)
goto fail_del_adapters;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <linux/version.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -541,19 +542,19 @@ static int pca9641_do_gpio_reset(struct i2c_mux_core *muxc)
usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1);
}

__gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on);
gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on);

if (reset_cfg->rst_delay) {
usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1);
}

__gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off);
gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off);
ret = -1;
udelay_cnt = 0;
timeout = reset_cfg->rst_delay_a;
while (timeout > 0) {
usleep_range(1, 2);
val = __gpio_get_value(gpio_attr->gpio);
val = gpio_get_value(gpio_attr->gpio);
if (val == gpio_attr->reset_off) {
ret = 0;
PCA_DEBUG("pca9641_do_gpio_reset success.\n");
Expand Down Expand Up @@ -1272,7 +1273,7 @@ static int pca9641_reset_data_init(struct pca9541 *data)
/*
* I2C init/probing/exit functions
*/
static int pca9541_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int pca9541_probe(struct i2c_client *client)
{
struct i2c_adapter *adap = client->adapter;
struct i2c_mux_core *muxc;
Expand Down Expand Up @@ -1322,7 +1323,7 @@ static int pca9541_probe(struct i2c_client *client, const struct i2c_device_id *
PCA_DEBUG("pca9641_nr: %d.\n", force);
}

ret = i2c_mux_add_adapter(muxc, force, 0, 0);
ret = i2c_mux_add_adapter(muxc, force, 0);
if (ret)
return ret;
} else {
Expand Down Expand Up @@ -1375,7 +1376,7 @@ static int pca9541_probe(struct i2c_client *client, const struct i2c_device_id *
}
}

ret = i2c_mux_add_adapter(muxc, force, 0, 0);
ret = i2c_mux_add_adapter(muxc, force, 0);
if (ret) {
dev_err(&client->dev, "Failed to register master selector.\n");
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/errno.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -1157,7 +1158,7 @@ static int ocores_i2c_probe(struct platform_device *pdev)
return ret;
}

static int ocores_i2c_remove(struct platform_device *pdev)
static void ocores_i2c_remove(struct platform_device *pdev)
{
struct ocores_i2c *i2c = platform_get_drvdata(pdev);
u8 ctrl = oc_getreg(i2c, OCI2C_CONTROL);
Expand All @@ -1168,7 +1169,6 @@ static int ocores_i2c_remove(struct platform_device *pdev)

/* remove adapter & data */
i2c_del_adapter(&i2c->adap);
return 0;
}

static struct platform_driver ocores_i2c_driver = {
Expand Down
Loading
Loading