Commit f5aae241 authored by Cai Huoqing's avatar Cai Huoqing Committed by Mauro Carvalho Chehab

media: cadence: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Acked-by: default avatarMaxime Ripard <maxime@cerno.tech>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e4aa275f
...@@ -279,13 +279,11 @@ static const struct v4l2_async_notifier_operations csi2rx_notifier_ops = { ...@@ -279,13 +279,11 @@ static const struct v4l2_async_notifier_operations csi2rx_notifier_ops = {
static int csi2rx_get_resources(struct csi2rx_priv *csi2rx, static int csi2rx_get_resources(struct csi2rx_priv *csi2rx,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct resource *res;
unsigned char i; unsigned char i;
u32 dev_cfg; u32 dev_cfg;
int ret; int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); csi2rx->base = devm_platform_ioremap_resource(pdev, 0);
csi2rx->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(csi2rx->base)) if (IS_ERR(csi2rx->base))
return PTR_ERR(csi2rx->base); return PTR_ERR(csi2rx->base);
......
...@@ -433,13 +433,11 @@ static const struct v4l2_subdev_ops csi2tx_subdev_ops = { ...@@ -433,13 +433,11 @@ static const struct v4l2_subdev_ops csi2tx_subdev_ops = {
static int csi2tx_get_resources(struct csi2tx_priv *csi2tx, static int csi2tx_get_resources(struct csi2tx_priv *csi2tx,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct resource *res;
unsigned int i; unsigned int i;
u32 dev_cfg; u32 dev_cfg;
int ret; int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); csi2tx->base = devm_platform_ioremap_resource(pdev, 0);
csi2tx->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(csi2tx->base)) if (IS_ERR(csi2tx->base))
return PTR_ERR(csi2tx->base); return PTR_ERR(csi2tx->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment