Commit 1cf69b7b authored by Vineeth Vijayan's avatar Vineeth Vijayan Committed by Heiko Carstens
Browse files

s390: remove pm support from console drivers



The power-management functions are unused since the
'commit 39421627 ("s390: remove broken hibernate / power management
support")'. Remove the unsued pm functions from the console drivers.

Signed-off-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 127fca60
Loading
Loading
Loading
Loading
+9 −76
Original line number Diff line number Diff line
@@ -289,7 +289,6 @@ static void raw3215_timeout(struct timer_list *t)

	spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
	raw->flags &= ~RAW3215_TIMER_RUNS;
	if (!tty_port_suspended(&raw->port)) {
	raw3215_mk_write_req(raw);
	raw3215_start_io(raw);
	if ((raw->queued_read || raw->queued_write) &&
@@ -299,7 +298,6 @@ static void raw3215_timeout(struct timer_list *t)
		add_timer(&raw->timer);
		raw->flags |= RAW3215_TIMER_RUNS;
	}
	}
	spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
}

@@ -311,7 +309,7 @@ static void raw3215_timeout(struct timer_list *t)
 */
static inline void raw3215_try_io(struct raw3215_info *raw)
{
	if (!tty_port_initialized(&raw->port) || tty_port_suspended(&raw->port))
	if (!tty_port_initialized(&raw->port))
		return;
	if (raw->queued_read != NULL)
		raw3215_start_io(raw);
@@ -463,26 +461,6 @@ static void raw3215_irq(struct ccw_device *cdev, unsigned long intparm,
	tty_kref_put(tty);
}

/*
 * Drop the oldest line from the output buffer.
 */
static void raw3215_drop_line(struct raw3215_info *raw)
{
	int ix;
	char ch;

	BUG_ON(raw->written != 0);
	ix = (raw->head - raw->count) & (RAW3215_BUFFER_SIZE - 1);
	while (raw->count > 0) {
		ch = raw->buffer[ix];
		ix = (ix + 1) & (RAW3215_BUFFER_SIZE - 1);
		raw->count--;
		if (ch == 0x15)
			break;
	}
	raw->head = ix;
}

/*
 * Wait until length bytes are available int the output buffer.
 * Has to be called with the s390irq lock held. Can be called
@@ -491,13 +469,6 @@ static void raw3215_drop_line(struct raw3215_info *raw)
static void raw3215_make_room(struct raw3215_info *raw, unsigned int length)
{
	while (RAW3215_BUFFER_SIZE - raw->count < length) {
		/* While console is frozen for suspend we have no other
		 * choice but to drop message from the buffer to make
		 * room for even more messages. */
		if (tty_port_suspended(&raw->port)) {
			raw3215_drop_line(raw);
			continue;
		}
		/* there might be a request pending */
		raw->flags |= RAW3215_FLUSHING;
		raw3215_mk_write_req(raw);
@@ -763,36 +734,6 @@ static int raw3215_set_offline (struct ccw_device *cdev)
	return 0;
}

static int raw3215_pm_stop(struct ccw_device *cdev)
{
	struct raw3215_info *raw;
	unsigned long flags;

	/* Empty the output buffer, then prevent new I/O. */
	raw = dev_get_drvdata(&cdev->dev);
	spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
	raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
	tty_port_set_suspended(&raw->port, 1);
	spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
	return 0;
}

static int raw3215_pm_start(struct ccw_device *cdev)
{
	struct raw3215_info *raw;
	unsigned long flags;

	/* Allow I/O again and flush output buffer. */
	raw = dev_get_drvdata(&cdev->dev);
	spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
	tty_port_set_suspended(&raw->port, 0);
	raw->flags |= RAW3215_FLUSHING;
	raw3215_try_io(raw);
	raw->flags &= ~RAW3215_FLUSHING;
	spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
	return 0;
}

static struct ccw_device_id raw3215_id[] = {
	{ CCW_DEVICE(0x3215, 0) },
	{ /* end of list */ },
@@ -808,9 +749,6 @@ static struct ccw_driver raw3215_ccw_driver = {
	.remove		= &raw3215_remove,
	.set_online	= &raw3215_set_online,
	.set_offline	= &raw3215_set_offline,
	.freeze		= &raw3215_pm_stop,
	.thaw		= &raw3215_pm_start,
	.restore	= &raw3215_pm_start,
	.int_class	= IRQIO_C15,
};

@@ -858,11 +796,6 @@ static void con3215_flush(void)
	unsigned long flags;

	raw = raw3215[0];  /* console 3215 is the first one */
	if (tty_port_suspended(&raw->port))
		/* The console is still frozen for suspend. */
		if (ccw_device_force_console(raw->cdev))
			/* Forcing didn't work, no panic message .. */
			return;
	spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
	raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
	spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
+0 −1
Original line number Diff line number Diff line
@@ -544,7 +544,6 @@ con3270_flush(void)
	cp = condev;
	if (!cp->view.dev)
		return;
	raw3270_pm_unfreeze(&cp->view);
	raw3270_activate_view(&cp->view);
	spin_lock_irqsave(&cp->view.lock, flags);
	con3270_wait_write(cp);
+6 −72
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ struct raw3270 {
#define RAW3270_FLAGS_14BITADDR	0	/* 14-bit buffer addresses */
#define RAW3270_FLAGS_BUSY	1	/* Device busy, leave it alone */
#define RAW3270_FLAGS_CONSOLE	2	/* Device is the console. */
#define RAW3270_FLAGS_FROZEN	3	/* set if 3270 is frozen for suspend */

/* Semaphore to protect global data of raw3270 (devices, views, etc). */
static DEFINE_MUTEX(raw3270_mutex);
@@ -260,8 +259,7 @@ raw3270_view_active(struct raw3270_view *view)
{
	struct raw3270 *rp = view->dev;

	return rp && rp->view == view &&
		!test_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
	return rp && rp->view == view;
}

int
@@ -273,8 +271,7 @@ raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)

	spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
	rp = view->dev;
	if (!rp || rp->view != view ||
	    test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
	if (!rp || rp->view != view)
		rc = -EACCES;
	else if (!raw3270_state_ready(rp))
		rc = -EBUSY;
@@ -291,8 +288,7 @@ raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq)
	int rc;

	rp = view->dev;
	if (!rp || rp->view != view ||
	    test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
	if (!rp || rp->view != view)
		rc = -EACCES;
	else if (!raw3270_state_ready(rp))
		rc = -EBUSY;
@@ -629,8 +625,7 @@ raw3270_reset(struct raw3270_view *view)
	int rc;

	rp = view->dev;
	if (!rp || rp->view != view ||
	    test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
	if (!rp || rp->view != view)
		rc = -EACCES;
	else if (!raw3270_state_ready(rp))
		rc = -EBUSY;
@@ -854,8 +849,6 @@ raw3270_activate_view(struct raw3270_view *view)
		rc = 0;
	else if (!raw3270_state_ready(rp))
		rc = -EBUSY;
	else if (test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
		rc = -EACCES;
	else {
		oldview = NULL;
		if (rp->view && rp->view->fn->deactivate) {
@@ -903,8 +896,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
		list_del_init(&view->list);
		list_add_tail(&view->list, &rp->view_list);
		/* Try to activate another view. */
		if (raw3270_state_ready(rp) &&
		    !test_bit(RAW3270_FLAGS_FROZEN, &rp->flags)) {
		if (raw3270_state_ready(rp)) {
			list_for_each_entry(view, &rp->view_list, list) {
				rp->view = view;
				if (view->fn->activate(view) == 0)
@@ -999,8 +991,7 @@ raw3270_del_view(struct raw3270_view *view)
		rp->view = NULL;
	}
	list_del_init(&view->list);
	if (!rp->view && raw3270_state_ready(rp) &&
	    !test_bit(RAW3270_FLAGS_FROZEN, &rp->flags)) {
	if (!rp->view && raw3270_state_ready(rp)) {
		/* Try to activate another view. */
		list_for_each_entry(nv, &rp->view_list, list) {
			if (nv->fn->activate(nv) == 0) {
@@ -1215,60 +1206,6 @@ raw3270_set_offline (struct ccw_device *cdev)
	return 0;
}

static int raw3270_pm_stop(struct ccw_device *cdev)
{
	struct raw3270 *rp;
	struct raw3270_view *view;
	unsigned long flags;

	rp = dev_get_drvdata(&cdev->dev);
	if (!rp)
		return 0;
	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
	if (rp->view && rp->view->fn->deactivate)
		rp->view->fn->deactivate(rp->view);
	if (!test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) {
		/*
		 * Release tty and fullscreen for all non-console
		 * devices.
		 */
		list_for_each_entry(view, &rp->view_list, list) {
			if (view->fn->release)
				view->fn->release(view);
		}
	}
	set_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
	return 0;
}

static int raw3270_pm_start(struct ccw_device *cdev)
{
	struct raw3270 *rp;
	unsigned long flags;

	rp = dev_get_drvdata(&cdev->dev);
	if (!rp)
		return 0;
	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
	clear_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
	if (rp->view && rp->view->fn->activate)
		rp->view->fn->activate(rp->view);
	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
	return 0;
}

void raw3270_pm_unfreeze(struct raw3270_view *view)
{
#ifdef CONFIG_TN3270_CONSOLE
	struct raw3270 *rp;

	rp = view->dev;
	if (rp && test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
		ccw_device_force_console(rp->cdev);
#endif
}

static struct ccw_device_id raw3270_id[] = {
	{ CCW_DEVICE(0x3270, 0) },
	{ CCW_DEVICE(0x3271, 0) },
@@ -1294,9 +1231,6 @@ static struct ccw_driver raw3270_ccw_driver = {
	.remove		= &raw3270_remove,
	.set_online	= &raw3270_set_online,
	.set_offline	= &raw3270_set_offline,
	.freeze		= &raw3270_pm_stop,
	.thaw		= &raw3270_pm_start,
	.restore	= &raw3270_pm_start,
	.int_class	= IRQIO_C70,
};

+0 −1
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ struct raw3270_notifier {

int raw3270_register_notifier(struct raw3270_notifier *);
void raw3270_unregister_notifier(struct raw3270_notifier *);
void raw3270_pm_unfreeze(struct raw3270_view *);

/*
 * Little memory allocator for string objects.