summaryrefslogtreecommitdiffstats
path: root/drivers/soc/mediatek/mtk-pmic-wrap.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-05-15 13:40:31 -0700
committerOlof Johansson <olof@lixom.net>2018-05-15 13:40:31 -0700
commitf6b3f4ac521523432761f4480dd3cad1a955593b (patch)
tree0260b06b33f196381495150b2a3a7ca0ef29b7e2 /drivers/soc/mediatek/mtk-pmic-wrap.c
parent3ea8f233cfe546d060360ce0d01844f60744fb21 (diff)
parent0afd32c6bb59e41b6692dec4473efaffffcad67b (diff)
downloadop-kernel-dev-f6b3f4ac521523432761f4480dd3cad1a955593b.zip
op-kernel-dev-f6b3f4ac521523432761f4480dd3cad1a955593b.tar.gz
Merge tag 'v4.17-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/drivers
- use timeout helpers for scpsys and infracfg drivers - use of_device_get_match_data in pmic wrapper and scpsys * tag 'v4.17-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: remove unneeded semicolon soc: mediatek: add a fixed wait for SRAM stable soc: mediatek: introduce a CAPS flag for scp_domain_data soc: mediatek: reuse regmap_read_poll_timeout helpers regmap: include <linux/ktime.h> from include/linux/regmap.h soc: mediatek: reuse read[l,x]_poll_timeout helpers soc: mediatek: use of_device_get_match_data() Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/soc/mediatek/mtk-pmic-wrap.c')
-rw-r--r--drivers/soc/mediatek/mtk-pmic-wrap.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index e9e054a..2afae64 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -1458,19 +1458,12 @@ static int pwrap_probe(struct platform_device *pdev)
int ret, irq;
struct pmic_wrapper *wrp;
struct device_node *np = pdev->dev.of_node;
- const struct of_device_id *of_id =
- of_match_device(of_pwrap_match_tbl, &pdev->dev);
const struct of_device_id *of_slave_id = NULL;
struct resource *res;
- if (!of_id) {
- dev_err(&pdev->dev, "Error: No device match found\n");
- return -ENODEV;
- }
+ if (np->child)
+ of_slave_id = of_match_node(of_slave_match_tbl, np->child);
- if (pdev->dev.of_node->child)
- of_slave_id = of_match_node(of_slave_match_tbl,
- pdev->dev.of_node->child);
if (!of_slave_id) {
dev_dbg(&pdev->dev, "slave pmic should be defined in dts\n");
return -EINVAL;
@@ -1482,7 +1475,7 @@ static int pwrap_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, wrp);
- wrp->master = of_id->data;
+ wrp->master = of_device_get_match_data(&pdev->dev);
wrp->slave = of_slave_id->data;
wrp->dev = &pdev->dev;
OpenPOWER on IntegriCloud