mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 13:23:18 +00:00
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>
This commit is contained in:
parent
66d6143ebf
commit
d652049e11
@ -354,7 +354,6 @@ static const struct file_operations gpio_mockup_debugfs_ops = {
|
||||
static void gpio_mockup_debugfs_setup(struct device *dev,
|
||||
struct gpio_mockup_chip *chip)
|
||||
{
|
||||
struct device *child __free(put_device) = NULL;
|
||||
struct gpio_mockup_dbgfs_private *priv;
|
||||
struct gpio_chip *gc;
|
||||
const char *devname;
|
||||
@ -367,7 +366,7 @@ static void gpio_mockup_debugfs_setup(struct device *dev,
|
||||
* There can only be a single GPIO device per platform device in
|
||||
* gpio-mockup so using device_find_any_child() is OK.
|
||||
*/
|
||||
child = device_find_any_child(dev);
|
||||
struct device *child __free(put_device) = device_find_any_child(dev);
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user