usb: gadget: pch_udc: Initialize device pointer before use
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 23 Mar 2021 15:36:25 +0000 (17:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:11 +0000 (09:50 +0200)
commit9f6e0fdb154c8ae5ffdccae3dbb6c4246ec29d16
tree952d8c0edd4b945c897207de2ce5bf7f8f8b42b0
parent3b6769806027f052edd4d98dd2fe8a1a17b5a10d
usb: gadget: pch_udc: Initialize device pointer before use

[ Upstream commit 971d080212be4ce2b91047d25a657f46d3e39635 ]

During conversion to use GPIO descriptors the device pointer,
which is applied to devm_gpiod_get(), is not yet initialized.

Move initialization in the ->probe() in order to have it set before use.

Fixes: e20849a8c883 ("usb: gadget: pch_udc: Convert to use GPIO descriptors")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210323153626.54908-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/pch_udc.c