pinctrl: lynxpoint: Use standard pattern for memory allocation
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 25 Nov 2019 16:26:35 +0000 (18:26 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 13 Dec 2019 14:48:48 +0000 (16:48 +0200)
The pattern
foo = kmalloc(sizeof(*foo), GFP_KERNEL);
has an advantage when foo type is changed. Since we are planning a such,
better to be prepared by using standard pattern for memory allocation.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pinctrl/intel/pinctrl-lynxpoint.c

index 36978a7c2a85cfc6fd6c058c200b84e3fe5ff77e..17a7843c8dc990bbee21ff40d2f5a9b1b34f4437 100644 (file)
@@ -327,7 +327,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
        unsigned long reg_len;
        int ret;
 
-       lg = devm_kzalloc(dev, sizeof(struct lp_gpio), GFP_KERNEL);
+       lg = devm_kzalloc(dev, sizeof(*lg), GFP_KERNEL);
        if (!lg)
                return -ENOMEM;