Skip to content

Commit

Permalink
leds: turris-omnia: fix checkpatch warning
Browse files Browse the repository at this point in the history
Use kstrtoul instead of sscanf to satisfy checkpatch.

Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Marek Behún authored and Pavel Machek committed Nov 25, 2020
1 parent 5d47ce1 commit fca050b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/leds/leds-turris-omnia.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ static ssize_t brightness_store(struct device *dev, struct device_attribute *a,
{
struct i2c_client *client = to_i2c_client(dev);
struct omnia_leds *leds = i2c_get_clientdata(client);
unsigned int brightness;
unsigned long brightness;
int ret;

if (sscanf(buf, "%u", &brightness) != 1)
if (kstrtoul(buf, 10, &brightness))
return -EINVAL;

if (brightness > 100)
Expand Down

0 comments on commit fca050b

Please sign in to comment.