msm: smd_tty: Handle error conditions in open operation

The smd_tty driver assumes the Linux TTY Framework will call the close
operation when the open operation returns an error. This assumption is
not valid with the recent tty_port refactoring.

The tty_port layer internally maintains a reference count of number of
times a tty device is opened. The tty_port layer invokes "activate"
operation when a tty device is opened for the first time and "shutdown"
operation when a tty device is closed for the last time.

Update the smd_tty driver to release any resource that is allocated when
the open operation hits an error scenario. Remove the redundant open_count
in the smd_tty driver.

CRs-Fixed: 470184
Change-Id: I50a126497b235bed895e01748c77d8a0660261b3
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
1 file changed