Skip to content

Commit

Permalink
hwmon: (dell-smm) Return -ENOIOCTLCMD instead of -EINVAL
Browse files Browse the repository at this point in the history
Returning -ENOIOCTLCMD gives the callers a better
hint of what went wrong and is the recommended
behavior.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20211021190531.17379-4-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Wer-Wolf authored and groeck committed Oct 21, 2021
1 parent 38c5b0d commit e64325e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwmon/dell-smm-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/hwmon.h>
#include <linux/init.h>
#include <linux/module.h>
Expand Down Expand Up @@ -516,7 +517,7 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd
break;

default:
return -EINVAL;
return -ENOIOCTLCMD;
}

if (val < 0)
Expand Down

0 comments on commit e64325e

Please sign in to comment.