Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175055
b: refs/heads/master
c: c0e6e7c
h: refs/heads/master
i:
  175053: 1081d0b
  175051: 54c35aa
  175047: 1448cf9
  175039: ec16a5f
v: v3
  • Loading branch information
Shawn Bohrer authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 551f86b commit 4b8ccd1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb950a169d98ac9a2b8a899f95ed5d784c14f3cc
refs/heads/master: c0e6e7c1b2409fd4968b256ae1d979e6df14b3f1
31 changes: 26 additions & 5 deletions trunk/drivers/staging/line6/variax.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ static ssize_t variax_set_volume(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
unsigned long value;
int ret;

ret = strict_strtoul(buf, 10, &value);
if (ret)
return ret;

if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_volume,
value) == 0)
Expand All @@ -211,7 +216,12 @@ static ssize_t variax_set_model(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
unsigned long value;
int ret;

ret = strict_strtoul(buf, 10, &value);
if (ret)
return ret;

if (line6_send_program(&variax->line6, value) == 0)
variax->model = value;
Expand All @@ -237,8 +247,14 @@ static ssize_t variax_set_active(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10) ? 1 : 0;
variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = value;
unsigned long value;
int ret;

ret = strict_strtoul(buf, 10, &value);
if (ret)
return ret;

variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = value ? 1: 0;
line6_send_raw_message_async(&variax->line6, variax->buffer_activate,
sizeof(variax_activate));
return count;
Expand All @@ -262,7 +278,12 @@ static ssize_t variax_set_tone(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
unsigned long value;
int ret;

ret = strict_strtoul(buf, 10, &value);
if (ret)
return ret;

if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_tone,
value) == 0)
Expand Down

0 comments on commit 4b8ccd1

Please sign in to comment.