]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Input: soc_button_array - use 'dev' instead of dereferencing it
authorGuenter Roeck <linux@roeck-us.net>
Wed, 18 Jan 2017 19:41:51 +0000 (11:41 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 18 Jan 2017 19:49:16 +0000 (11:49 -0800)
Use local variable 'dev' instead of dereferencing it several times.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/soc_button_array.c

index 908b51089dee4b1cb128393cba441eecc477c994..fb3219a8d3c0baf8fa8f1d01a46c23448e65088a 100644 (file)
@@ -167,12 +167,12 @@ static int soc_button_probe(struct platform_device *pdev)
 
        button_info = (struct soc_button_info *)id->driver_data;
 
-       if (gpiod_count(&pdev->dev, KBUILD_MODNAME) <= 0) {
-               dev_dbg(&pdev->dev, "no GPIO attached, ignoring...\n");
+       if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
+               dev_dbg(dev, "no GPIO attached, ignoring...\n");
                return -ENODEV;
        }
 
-       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;