Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304145
b: refs/heads/master
c: 881e18f
h: refs/heads/master
i:
  304143: 90c8d0a
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 9, 2012
1 parent 3493246 commit 6c46733
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d2ae2335ce69249403061da4f0da63d9b0763f6
refs/heads/master: 881e18f960478013b49a48ed6f7b3bf60c6f874f
42 changes: 19 additions & 23 deletions trunk/drivers/s390/char/tty3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ tty3270_blank_line(struct tty3270 *tp)
static void
tty3270_write_callback(struct raw3270_request *rq, void *data)
{
struct tty3270 *tp;
struct tty3270 *tp = container_of(rq->view, struct tty3270, view);

tp = (struct tty3270 *) rq->view;
if (rq->rc != 0) {
/* Write wasn't successful. Refresh all. */
tp->update_flags = TTY_UPDATE_ALL;
Expand Down Expand Up @@ -537,11 +536,10 @@ static void
tty3270_read_tasklet(struct raw3270_request *rrq)
{
static char kreset_data = TW_KR;
struct tty3270 *tp;
struct tty3270 *tp = container_of(rrq->view, struct tty3270, view);
char *input;
int len;

tp = (struct tty3270 *) rrq->view;
spin_lock_bh(&tp->view.lock);
/*
* Two AID keys are special: For 0x7d (enter) the input line
Expand Down Expand Up @@ -596,9 +594,10 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
static void
tty3270_read_callback(struct raw3270_request *rq, void *data)
{
struct tty3270 *tp = container_of(rq->view, struct tty3270, view);
raw3270_get_view(rq->view);
/* Schedule tasklet to pass input to tty. */
tasklet_schedule(&((struct tty3270 *) rq->view)->readlet);
tasklet_schedule(&tp->readlet);
}

/*
Expand Down Expand Up @@ -635,9 +634,8 @@ tty3270_issue_read(struct tty3270 *tp, int lock)
static int
tty3270_activate(struct raw3270_view *view)
{
struct tty3270 *tp;
struct tty3270 *tp = container_of(view, struct tty3270, view);

tp = (struct tty3270 *) view;
tp->update_flags = TTY_UPDATE_ALL;
tty3270_set_timer(tp, 1);
return 0;
Expand All @@ -646,9 +644,8 @@ tty3270_activate(struct raw3270_view *view)
static void
tty3270_deactivate(struct raw3270_view *view)
{
struct tty3270 *tp;
struct tty3270 *tp = container_of(view, struct tty3270, view);

tp = (struct tty3270 *) view;
del_timer(&tp->timer);
}

Expand Down Expand Up @@ -804,10 +801,9 @@ tty3270_free_screen(struct tty3270 *tp)
static void
tty3270_release(struct raw3270_view *view)
{
struct tty3270 *tp;
struct tty3270 *tp = container_of(view, struct tty3270, view);
struct tty_struct *tty;

tp = (struct tty3270 *) view;
tty = tp->tty;
if (tty) {
tty->driver_data = NULL;
Expand All @@ -823,8 +819,9 @@ tty3270_release(struct raw3270_view *view)
static void
tty3270_free(struct raw3270_view *view)
{
tty3270_free_screen((struct tty3270 *) view);
tty3270_free_view((struct tty3270 *) view);
struct tty3270 *tp = container_of(view, struct tty3270, view);
tty3270_free_screen(tp);
tty3270_free_view(tp);
}

/*
Expand All @@ -833,14 +830,13 @@ tty3270_free(struct raw3270_view *view)
static void
tty3270_del_views(void)
{
struct tty3270 *tp;
int i;

for (i = 0; i < tty3270_max_index; i++) {
tp = (struct tty3270 *)
struct raw3270_view *view =
raw3270_find_view(&tty3270_fn, i + RAW3270_FIRSTMINOR);
if (!IS_ERR(tp))
raw3270_del_view(&tp->view);
if (!IS_ERR(view))
raw3270_del_view(view);
}
}

Expand All @@ -858,16 +854,17 @@ static struct raw3270_fn tty3270_fn = {
static int
tty3270_open(struct tty_struct *tty, struct file * filp)
{
struct raw3270_view *view;
struct tty3270 *tp;
int i, rc;

if (tty->count > 1)
return 0;
/* Check if the tty3270 is already there. */
tp = (struct tty3270 *)
raw3270_find_view(&tty3270_fn,
view = raw3270_find_view(&tty3270_fn,
tty->index + RAW3270_FIRSTMINOR);
if (!IS_ERR(tp)) {
if (!IS_ERR(view)) {
tp = container_of(view, struct tty3270, view);
tty->driver_data = tp;
tty->winsize.ws_row = tp->view.rows - 2;
tty->winsize.ws_col = tp->view.cols;
Expand All @@ -881,7 +878,7 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
tty3270_max_index = tty->index + 1;

/* Quick exit if there is no device for tty->index. */
if (PTR_ERR(tp) == -ENODEV)
if (PTR_ERR(view) == -ENODEV)
return -ENODEV;

/* Allocate tty3270 structure on first open. */
Expand Down Expand Up @@ -935,11 +932,10 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
static void
tty3270_close(struct tty_struct *tty, struct file * filp)
{
struct tty3270 *tp;
struct tty3270 *tp = tty->driver_data;

if (tty->count > 1)
return;
tp = (struct tty3270 *) tty->driver_data;
if (tp) {
tty->driver_data = NULL;
tp->tty = tp->kbd->tty = NULL;
Expand Down

0 comments on commit 6c46733

Please sign in to comment.