[v2,06/24] pinctrl: lynxpoint: Use standard pattern for memory allocation
diff mbox series

Message ID 20191209130926.86483-7-andriy.shevchenko@linux.intel.com
State New
Headers show
  • pinctrl: intel: Move Lynxpoint to pin control umbrella
Related show

Commit Message

Andy Shevchenko Dec. 9, 2019, 1:09 p.m. UTC
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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index 36978a7c2a85..17a7843c8dc9 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -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;