If the module parameters are invalid, we should bail out from the init
function instead of detecting it during the device probe. That way we
don't even allow the user to load the module if we don't accept the
arguments.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
struct gpio_mockup_chip *chips;
char *chip_name;
- if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2))
- return -EINVAL;
-
/* Each chip is described by two values. */
num_chips = gpio_mockup_params_nr / 2;
{
int err;
+ if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2))
+ return -EINVAL;
+
gpio_mockup_dbg_dir = debugfs_create_dir("gpio-mockup-event", NULL);
if (!gpio_mockup_dbg_dir)
pr_err("%s: error creating debugfs directory\n",