Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 359f9caa authored by Andreas Ruprecht's avatar Andreas Ruprecht Committed by Greg Kroah-Hartman
Browse files

Staging: iio/accel: Changed data type for val to unsigned long in write_frequency



In lis3102dq_write_frequency() we used a long variable to store the
value parsed from the char* buffer buf, as there only was a
strict_strtol() function to parse values.
Now we have got kstrto* which allows us to convert to the right data
type in most cases.

In this particular function we want to write a frequency value, and it
doesn't make sense to allow negative values here (as Dan Carpenter
pointed out in a previous email).
This means we can now parse the value into an unsigned long and get an
error for invalid (e.g. negative) values.

Signed-off-by: default avatarAndreas Ruprecht <rupran@einserver.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bae5b537
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment