ehv_bytechan.c (69851e4ab8feeb369119a44ddca430c0ee15f0d8) | ehv_bytechan.c (95713967ba52389f7cea75704d0cf048080ec218) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* ePAPR hypervisor byte channel device driver 3 * 4 * Copyright 2009-2011 Freescale Semiconductor, Inc. 5 * 6 * Author: Timur Tabi <timur@freescale.com> 7 * 8 * This driver support three distinct interfaces, all of which are related to --- 452 unchanged lines hidden (view full) --- 461 * as possible. 462 * 463 * We don't need to worry about whether there is enough room in the buffer for 464 * all the data. The purpose of ehv_bc_tty_write_room() is to tell the tty 465 * layer how much data it can safely send to us. We guarantee that 466 * ehv_bc_tty_write_room() will never lie, so the tty layer will never send us 467 * too much data. 468 */ | 1// SPDX-License-Identifier: GPL-2.0 2/* ePAPR hypervisor byte channel device driver 3 * 4 * Copyright 2009-2011 Freescale Semiconductor, Inc. 5 * 6 * Author: Timur Tabi <timur@freescale.com> 7 * 8 * This driver support three distinct interfaces, all of which are related to --- 452 unchanged lines hidden (view full) --- 461 * as possible. 462 * 463 * We don't need to worry about whether there is enough room in the buffer for 464 * all the data. The purpose of ehv_bc_tty_write_room() is to tell the tty 465 * layer how much data it can safely send to us. We guarantee that 466 * ehv_bc_tty_write_room() will never lie, so the tty layer will never send us 467 * too much data. 468 */ |
469static int ehv_bc_tty_write(struct tty_struct *ttys, const u8 *s, int count) | 469static ssize_t ehv_bc_tty_write(struct tty_struct *ttys, const u8 *s, 470 size_t count) |
470{ 471 struct ehv_bc_data *bc = ttys->driver_data; 472 unsigned long flags; 473 unsigned int len; 474 unsigned int written = 0; 475 476 while (1) { 477 spin_lock_irqsave(&bc->lock, flags); --- 340 unchanged lines hidden --- | 471{ 472 struct ehv_bc_data *bc = ttys->driver_data; 473 unsigned long flags; 474 unsigned int len; 475 unsigned int written = 0; 476 477 while (1) { 478 spin_lock_irqsave(&bc->lock, flags); --- 340 unchanged lines hidden --- |