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

Commit 78cab5d3 authored by Mayank Rana's avatar Mayank Rana
Browse files

eud: Set pdev->id value to 0 and add set_mctrl() API



pdev->id is needed to reference port with serial core framework.
Also serial core framework assumes that set_mctrl() ops is must
to support. Hence add set_mctrl() API to avoid null pointer
related crash within serial core framework.

Change-Id: Ida4ec2622232b822f1100e9c4ce0e8d3bd0d29c9
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 43ee8667
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -286,6 +286,11 @@ static unsigned int eud_tx_empty(struct uart_port *port)
		return 0;
}

static void eud_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
	/* Nothing to set */
}

static void eud_stop_tx(struct uart_port *port)
{
	/* Disable Tx interrupt */
@@ -365,6 +370,7 @@ static int eud_verify_port(struct uart_port *port,
/* serial functions supported */
static const struct uart_ops eud_uart_ops = {
	.tx_empty	= eud_tx_empty,
	.set_mctrl	= eud_set_mctrl,
	.stop_tx	= eud_stop_tx,
	.start_tx	= eud_start_tx,
	.stop_rx	= eud_stop_rx,
@@ -593,6 +599,7 @@ static int msm_eud_probe(struct platform_device *pdev)

	INIT_WORK(&chip->eud_work, eud_event_notifier);

	pdev->id = 0;
	port = &chip->port;
	port->line = pdev->id;
	port->type = PORT_EUD_UART;