Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: serdev: drop serdev_controller_ops::write_room()

In particular, serdev_device_write_room() is not called, so the whole
serdev's write_room() can go.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-17-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
5af89030 52443558

-26
-11
drivers/tty/serdev/core.c
··· 316 316 } 317 317 EXPORT_SYMBOL_GPL(serdev_device_write_flush); 318 318 319 - int serdev_device_write_room(struct serdev_device *serdev) 320 - { 321 - struct serdev_controller *ctrl = serdev->ctrl; 322 - 323 - if (!ctrl || !ctrl->ops->write_room) 324 - return 0; 325 - 326 - return serdev->ctrl->ops->write_room(ctrl); 327 - } 328 - EXPORT_SYMBOL_GPL(serdev_device_write_room); 329 - 330 319 unsigned int serdev_device_set_baudrate(struct serdev_device *serdev, unsigned int speed) 331 320 { 332 321 struct serdev_controller *ctrl = serdev->ctrl;
-9
drivers/tty/serdev/serdev-ttyport.c
··· 92 92 tty_driver_flush_buffer(tty); 93 93 } 94 94 95 - static int ttyport_write_room(struct serdev_controller *ctrl) 96 - { 97 - struct serport *serport = serdev_controller_get_drvdata(ctrl); 98 - struct tty_struct *tty = serport->tty; 99 - 100 - return tty_write_room(tty); 101 - } 102 - 103 95 static int ttyport_open(struct serdev_controller *ctrl) 104 96 { 105 97 struct serport *serport = serdev_controller_get_drvdata(ctrl); ··· 251 259 static const struct serdev_controller_ops ctrl_ops = { 252 260 .write_buf = ttyport_write_buf, 253 261 .write_flush = ttyport_write_flush, 254 - .write_room = ttyport_write_room, 255 262 .open = ttyport_open, 256 263 .close = ttyport_close, 257 264 .set_flow_control = ttyport_set_flow_control,
-6
include/linux/serdev.h
··· 84 84 struct serdev_controller_ops { 85 85 ssize_t (*write_buf)(struct serdev_controller *, const u8 *, size_t); 86 86 void (*write_flush)(struct serdev_controller *); 87 - int (*write_room)(struct serdev_controller *); 88 87 int (*open)(struct serdev_controller *); 89 88 void (*close)(struct serdev_controller *); 90 89 void (*set_flow_control)(struct serdev_controller *, bool); ··· 211 212 void serdev_device_write_wakeup(struct serdev_device *); 212 213 ssize_t serdev_device_write(struct serdev_device *, const u8 *, size_t, long); 213 214 void serdev_device_write_flush(struct serdev_device *); 214 - int serdev_device_write_room(struct serdev_device *); 215 215 216 216 /* 217 217 * serdev device driver functions ··· 271 273 return -ENODEV; 272 274 } 273 275 static inline void serdev_device_write_flush(struct serdev_device *sdev) {} 274 - static inline int serdev_device_write_room(struct serdev_device *sdev) 275 - { 276 - return 0; 277 - } 278 276 279 277 #define serdev_device_driver_register(x) 280 278 #define serdev_device_driver_unregister(x)