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

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

Merge "radio: iris: Check SMD channel state on init."

parents 16776970 184b5a87
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static void radio_hci_smd_exit(void);

static void radio_hci_smd_destruct(struct radio_hci_dev *hdev)
{
	radio_hci_unregister_dev(hs.hdev);
	radio_hci_unregister_dev();
}


@@ -171,7 +171,6 @@ static int radio_hci_smd_register_dev(struct radio_data *hsmd)
	if (hdev == NULL)
		return -ENODEV;

	hsmd->hdev = hdev;
	tasklet_init(&hsmd->rx_task, radio_hci_smd_recv_event,
		(unsigned long) hsmd);
	hdev->send  = radio_hci_smd_send_frame;
@@ -199,12 +198,13 @@ static int radio_hci_smd_register_dev(struct radio_data *hsmd)
		return -ENODEV;
	}

	hsmd->hdev = hdev;
	return 0;
}

static void radio_hci_smd_deregister(void)
{
	radio_hci_unregister_dev(hs.hdev);
	radio_hci_unregister_dev();
	kfree(hs.hdev);
	hs.hdev = NULL;

@@ -217,6 +217,11 @@ static int radio_hci_smd_init(void)
{
	int ret;

	if (chan_opened) {
		FMDBG("Channel is already opened");
		return 0;
	}

	/* this should be called with fm_smd_enable lock held */
	ret = radio_hci_smd_register_dev(&hs);
	if (ret < 0) {
@@ -230,6 +235,11 @@ static int radio_hci_smd_init(void)

static void radio_hci_smd_exit(void)
{
	if (!chan_opened) {
		FMDBG("Channel already closed");
		return;
	}

	/* this should be called with fm_smd_enable lock held */
	radio_hci_smd_deregister();
	chan_opened = false;
+5 −3
Original line number Diff line number Diff line
@@ -618,14 +618,16 @@ int radio_hci_register_dev(struct radio_hci_dev *hdev)
}
EXPORT_SYMBOL(radio_hci_register_dev);

int radio_hci_unregister_dev(struct radio_hci_dev *hdev)
int radio_hci_unregister_dev(void)
{
	struct iris_device *radio = video_get_drvdata(video_get_dev());
	struct radio_hci_dev *hdev = NULL;

	if (!radio) {
		FMDERR(":radio is null");
	if (!radio && !radio->fm_hdev) {
		FMDERR("radio/hdev is null");
		return -EINVAL;
	}
	hdev = radio->fm_hdev;

	tasklet_kill(&hdev->rx_task);
	tasklet_kill(&hdev->cmd_task);
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ struct radio_hci_dev {
};

int radio_hci_register_dev(struct radio_hci_dev *hdev);
int radio_hci_unregister_dev(struct radio_hci_dev *hdev);
int radio_hci_unregister_dev(void);
int radio_hci_recv_frame(struct sk_buff *skb);
int radio_hci_send_cmd(struct radio_hci_dev *hdev, __u16 opcode, __u32 plen,
	void *param);