diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2019-08-02 13:08:04 +0200 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@st.com> | 2019-08-27 11:19:23 +0200 |
commit | ef32dcf1195efba19e896f993a6bc4882280f081 (patch) | |
tree | a04a93c65e95aaf3fef1a28f3c5e8f9760d2e78b /drivers/power/pmic | |
parent | 234a60244c62ffce5c5c1d5b80d200f4568c5cfd (diff) | |
download | u-boot-ef32dcf1195efba19e896f993a6bc4882280f081.tar.gz |
stpmic1: simplify stpmic1_sysreset_request
Retrieve parent device from dev->parent instead of
calling uclass_get_device_by_driver()
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/power/pmic')
-rw-r--r-- | drivers/power/pmic/stpmic1.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c index 509baed7ec..de31934f41 100644 --- a/drivers/power/pmic/stpmic1.c +++ b/drivers/power/pmic/stpmic1.c @@ -232,19 +232,12 @@ U_BOOT_DRIVER(stpmic1_nvm) = { #ifdef CONFIG_SYSRESET static int stpmic1_sysreset_request(struct udevice *dev, enum sysreset_t type) { - struct udevice *pmic_dev; + struct udevice *pmic_dev = dev->parent; int ret; if (type != SYSRESET_POWER && type != SYSRESET_POWER_OFF) return -EPROTONOSUPPORT; - ret = uclass_get_device_by_driver(UCLASS_PMIC, - DM_GET_DRIVER(pmic_stpmic1), - &pmic_dev); - - if (ret) - return -EOPNOTSUPP; - ret = pmic_reg_read(pmic_dev, STPMIC1_MAIN_CR); if (ret < 0) return ret; |