Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bedf1298 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: dci: Initialize diag dci channels correctly"

parents 08cce388 d0d6a47d
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -2518,7 +2518,6 @@ err:
int diag_dci_init(void)
{
	int ret = 0;
	uint8_t peripheral;

	driver->dci_tag = 0;
	driver->dci_client_id = 0;
@@ -2532,11 +2531,6 @@ int diag_dci_init(void)
	if (ret)
		goto err;

	for (peripheral = 0; peripheral < NUM_PERIPHERALS; peripheral++) {
		diagfwd_open(peripheral, TYPE_DCI);
		diagfwd_open(peripheral, TYPE_DCI_CMD);
	}

	if (driver->apps_dci_buf == NULL) {
		driver->apps_dci_buf = kzalloc(DCI_BUF_SIZE, GFP_KERNEL);
		if (driver->apps_dci_buf == NULL)
@@ -2566,6 +2560,16 @@ err:
	return DIAG_DCI_NO_REG;
}

void diag_dci_channel_init(void)
{
	uint8_t peripheral;

	for (peripheral = 0; peripheral < NUM_PERIPHERALS; peripheral++) {
		diagfwd_open(peripheral, TYPE_DCI);
		diagfwd_open(peripheral, TYPE_DCI_CMD);
	}
}

void diag_dci_exit(void)
{
	kfree(partial_pkt.data);
+1 −0
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ extern struct mutex dci_stat_mutex;
#endif

int diag_dci_init(void);
void diag_dci_channel_init(void);
void diag_dci_exit(void);
int diag_dci_register_client(struct diag_dci_reg_tbl_t *reg_entry);
int diag_dci_deinit_client(struct diag_dci_client_tbl *entry);
+6 −3
Original line number Diff line number Diff line
@@ -2966,15 +2966,18 @@ static int __init diagchar_init(void)
	if (ret)
		goto fail;
	ret = diagfwd_bridge_init();
	if (ret)
		goto fail;
	ret = diagfwd_peripheral_init();
	if (ret)
		goto fail;
	ret = diagfwd_cntl_init();
	if (ret)
		goto fail;
	driver->dci_state = diag_dci_init();
	ret = diagfwd_peripheral_init();
	if (ret)
		goto fail;
	diagfwd_cntl_channel_init();
	if (driver->dci_state == DIAG_DCI_NO_ERROR)
		diag_dci_channel_init();
	pr_debug("diagchar initializing ..\n");
	driver->num = 1;
	driver->name = ((void *)driver) + sizeof(struct diagchar_dev);
+7 −4
Original line number Diff line number Diff line
@@ -1246,8 +1246,6 @@ int diag_send_buffering_wm_values(uint8_t peripheral,

int diagfwd_cntl_init(void)
{
	uint8_t peripheral;

	reg_dirty = 0;
	driver->polling_reg_flag = 0;
	driver->log_on_demand_support = 1;
@@ -1263,12 +1261,17 @@ int diagfwd_cntl_init(void)
	if (!driver->cntl_wq)
		return -ENOMEM;

	return 0;
}

void diagfwd_cntl_channel_init(void)
{
	uint8_t peripheral;

	for (peripheral = 0; peripheral < NUM_PERIPHERALS; peripheral++) {
		diagfwd_early_open(peripheral);
		diagfwd_open(peripheral, TYPE_CNTL);
	}

	return 0;
}

void diagfwd_cntl_exit(void)
+1 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ struct diag_ctrl_set_wq_val {
} __packed;

int diagfwd_cntl_init(void);
void diagfwd_cntl_channel_init(void);
void diagfwd_cntl_exit(void);
void diag_cntl_channel_open(struct diagfwd_info *p_info);
void diag_cntl_channel_close(struct diagfwd_info *p_info);