aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r--drivers/staging/greybus/hid.c3
-rw-r--r--drivers/staging/greybus/light.c3
-rw-r--r--drivers/staging/greybus/loopback.c2
-rw-r--r--drivers/staging/greybus/uart.c19
4 files changed, 8 insertions, 19 deletions
diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c
index 04bfd9110502..ed706f39e87a 100644
--- a/drivers/staging/greybus/hid.c
+++ b/drivers/staging/greybus/hid.c
@@ -290,9 +290,8 @@ static int gb_hid_parse(struct hid_device *hid)
}
rdesc = kzalloc(rsize, GFP_KERNEL);
- if (!rdesc) {
+ if (!rdesc)
return -ENOMEM;
- }
ret = gb_hid_get_report_desc(ghid, rdesc);
if (ret) {
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index d6ba25f21d80..d2672b65c3f4 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -1026,7 +1026,8 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id)
light->channels_count = conf.channel_count;
light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL);
-
+ if (!light->name)
+ return -ENOMEM;
light->channels = kcalloc(light->channels_count,
sizeof(struct gb_channel), GFP_KERNEL);
if (!light->channels)
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 583d9708a191..2471448ba42a 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -135,7 +135,7 @@ static ssize_t name##_##field##_show(struct device *dev, \
char *buf) \
{ \
struct gb_loopback *gb = dev_get_drvdata(dev); \
- /* Report 0 for min and max if no transfer successed */ \
+ /* Report 0 for min and max if no transfer succeeded */ \
if (!gb->requests_completed) \
return sprintf(buf, "0\n"); \
return sprintf(buf, "%" #type "\n", gb->name.field); \
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 4ffb334cd5cd..607378bfebb7 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -40,14 +40,6 @@
#define GB_UART_FIRMWARE_CREDITS 4096
#define GB_UART_CREDIT_WAIT_TIMEOUT_MSEC 10000
-struct gb_tty_line_coding {
- __le32 rate;
- __u8 format;
- __u8 parity;
- __u8 data_bits;
- __u8 flow_control;
-};
-
struct gb_tty {
struct gbphy_device *gbphy_dev;
struct tty_port port;
@@ -66,7 +58,7 @@ struct gb_tty {
struct mutex mutex;
u8 ctrlin; /* input control lines */
u8 ctrlout; /* output control lines */
- struct gb_tty_line_coding line_coding;
+ struct gb_uart_set_line_coding_request line_coding;
struct work_struct tx_work;
struct kfifo write_fifo;
bool close_pending;
@@ -288,12 +280,9 @@ static void gb_uart_tx_write_work(struct work_struct *work)
static int send_line_coding(struct gb_tty *tty)
{
- struct gb_uart_set_line_coding_request request;
-
- memcpy(&request, &tty->line_coding,
- sizeof(tty->line_coding));
return gb_operation_sync(tty->connection, GB_UART_TYPE_SET_LINE_CODING,
- &request, sizeof(request), NULL, 0);
+ &tty->line_coding, sizeof(tty->line_coding),
+ NULL, 0);
}
static int send_control(struct gb_tty *gb_tty, u8 control)
@@ -493,9 +482,9 @@ static int gb_tty_break_ctl(struct tty_struct *tty, int state)
static void gb_tty_set_termios(struct tty_struct *tty,
struct ktermios *termios_old)
{
+ struct gb_uart_set_line_coding_request newline;
struct gb_tty *gb_tty = tty->driver_data;
struct ktermios *termios = &tty->termios;
- struct gb_tty_line_coding newline;
u8 newctrl = gb_tty->ctrlout;
newline.rate = cpu_to_le32(tty_get_baud_rate(tty));