Skip to content

Commit

Permalink
gpio: stmpe: Move an assignment in stmpe_gpio_probe()
Browse files Browse the repository at this point in the history
Move the assignment for the local variable "irq" so that its setting
will only be performed directly before it is checked by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Markus Elfring authored and Linus Walleij committed Jan 17, 2018
1 parent 64fec0b commit 757ad05
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpio/gpio-stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
int ret;
int irq = 0;

irq = platform_get_irq(pdev, 0);

stmpe_gpio = kzalloc(sizeof(*stmpe_gpio), GFP_KERNEL);
if (!stmpe_gpio)
return -ENOMEM;
Expand All @@ -459,6 +457,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
if (stmpe_gpio->norequest_mask)
stmpe_gpio->chip.irq.need_valid_mask = true;

irq = platform_get_irq(pdev, 0);
if (irq < 0)
dev_info(&pdev->dev,
"device configured in no-irq mode: "
Expand Down

0 comments on commit 757ad05

Please sign in to comment.