diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2018-01-12 20:44:15 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-17 07:44:15 +0100 |
commit | 757ad058da83c800891bffd0bcba232853104892 (patch) | |
tree | 19d8679b38bae0ba4004a0de3126b509c4b1a3ee /drivers/gpio/gpio-stmpe.c | |
parent | gpio: stmpe: Improve a size determination in stmpe_gpio_probe() (diff) | |
download | linux-757ad058da83c800891bffd0bcba232853104892.tar.xz linux-757ad058da83c800891bffd0bcba232853104892.zip |
gpio: stmpe: Move an assignment in stmpe_gpio_probe()
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>
Diffstat (limited to 'drivers/gpio/gpio-stmpe.c')
-rw-r--r-- | drivers/gpio/gpio-stmpe.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index b041c1768ecc..420892ccc316 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -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; @@ -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: " |