summaryrefslogtreecommitdiffstats
path: root/include/linux/serdev.h
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2017-04-28 13:47:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-18 16:45:53 +0200
commit6bdc00d01e202ae11fa1cae0dacbef895434483d (patch)
treea63599f56e4bb468fa627f040d7f678cfe09be2e /include/linux/serdev.h
parent88e2582e90bb89fe895ff0dceeb5d5ab65d07997 (diff)
downloadlinux-stable-6bdc00d01e202ae11fa1cae0dacbef895434483d.tar.gz
linux-stable-6bdc00d01e202ae11fa1cae0dacbef895434483d.tar.bz2
linux-stable-6bdc00d01e202ae11fa1cae0dacbef895434483d.zip
serdev: Restore serdev_device_write_buf for atomic context
Starting with commit 6fe729c4bdae ("serdev: Add serdev_device_write subroutine") the function serdev_device_write_buf cannot be used in atomic context anymore (mutex_lock is sleeping). So restore the old behavior. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Fixes: 6fe729c4bdae ("serdev: Add serdev_device_write subroutine") Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serdev.h')
-rw-r--r--include/linux/serdev.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index cda76c6506ca..e2a225bf716d 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -195,6 +195,7 @@ int serdev_device_open(struct serdev_device *);
void serdev_device_close(struct serdev_device *);
unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
void serdev_device_set_flow_control(struct serdev_device *, bool);
+int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
void serdev_device_wait_until_sent(struct serdev_device *, long);
int serdev_device_get_tiocm(struct serdev_device *);
int serdev_device_set_tiocm(struct serdev_device *, int, int);
@@ -236,6 +237,12 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev
return 0;
}
static inline void serdev_device_set_flow_control(struct serdev_device *sdev, bool enable) {}
+static inline int serdev_device_write_buf(struct serdev_device *serdev,
+ const unsigned char *buf,
+ size_t count)
+{
+ return -ENODEV;
+}
static inline void serdev_device_wait_until_sent(struct serdev_device *sdev, long timeout) {}
static inline int serdev_device_get_tiocm(struct serdev_device *serdev)
{
@@ -312,11 +319,4 @@ static inline struct device *serdev_tty_port_register(struct tty_port *port,
static inline void serdev_tty_port_unregister(struct tty_port *port) {}
#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */
-static inline int serdev_device_write_buf(struct serdev_device *serdev,
- const unsigned char *data,
- size_t count)
-{
- return serdev_device_write(serdev, data, count, 0);
-}
-
#endif /*_LINUX_SERDEV_H */