diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-06 21:36:06 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-07-19 10:26:48 +0300 |
commit | 2cabb7ade7a0a1c8da62ba4ed18e71a7d54e7c62 (patch) | |
tree | 1f3a9b8fe13435c6aafeba25f015676ba736639b /drivers/media/platform | |
parent | 573e298cfe679490a43e6d439885b79f5bd63e23 (diff) | |
download | linux-2cabb7ade7a0a1c8da62ba4ed18e71a7d54e7c62.tar.xz |
media: ti-vpe: cal: Use syscon_regmap_lookup_by_phandle_args()
Use the syscon_regmap_lookup_by_phandle_args() function to replace
manual lookup of the syscon regmap offset. This simplifies the
cal_camerarx_init_regmap() implementation.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/ti-vpe/cal.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 6607e359855d..cb567d313035 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -995,17 +995,14 @@ static int cal_camerarx_init_regmap(struct cal_dev *cal) { struct device_node *np = cal->pdev->dev.of_node; struct regmap *syscon; - u32 syscon_offset; - int ret; + unsigned int offset; - syscon = syscon_regmap_lookup_by_phandle(np, "ti,camerrx-control"); - ret = of_property_read_u32_index(np, "ti,camerrx-control", 1, - &syscon_offset); - if (IS_ERR(syscon)) - ret = PTR_ERR(syscon); - if (ret) { + syscon = syscon_regmap_lookup_by_phandle_args(np, "ti,camerrx-control", + 1, &offset); + if (IS_ERR(syscon)) { dev_warn(&cal->pdev->dev, - "failed to get ti,camerrx-control: %d\n", ret); + "failed to get ti,camerrx-control: %ld\n", + PTR_ERR(syscon)); /* * Backward DTS compatibility. @@ -1021,11 +1018,11 @@ static int cal_camerarx_init_regmap(struct cal_dev *cal) /* In this case the base already point to the direct * CM register so no need for an offset */ - syscon_offset = 0; + offset = 0; } cal->syscon_camerrx = syscon; - cal->syscon_camerrx_offset = syscon_offset; + cal->syscon_camerrx_offset = offset; return 0; } |