Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mockup: initialize a managed pointer in place

The preferred pattern for autopointers is to initialize them when they're
declared unless it doesn't make sense. Move the declaration of the
managed device pointer to where it's initialized.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+1 -2
+1 -2
drivers/gpio/gpio-mockup.c
··· 354 354 static void gpio_mockup_debugfs_setup(struct device *dev, 355 355 struct gpio_mockup_chip *chip) 356 356 { 357 - struct device *child __free(put_device) = NULL; 358 357 struct gpio_mockup_dbgfs_private *priv; 359 358 struct gpio_chip *gc; 360 359 const char *devname; ··· 366 367 * There can only be a single GPIO device per platform device in 367 368 * gpio-mockup so using device_find_any_child() is OK. 368 369 */ 369 - child = device_find_any_child(dev); 370 + struct device *child __free(put_device) = device_find_any_child(dev); 370 371 if (!child) 371 372 return; 372 373