media: cec: s5p_cec: 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: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
97ef3b7f4f
commit
399e0f9a0d
|
@ -178,7 +178,6 @@ static int s5p_cec_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct device *hdmi_dev;
|
struct device *hdmi_dev;
|
||||||
struct resource *res;
|
|
||||||
struct s5p_cec_dev *cec;
|
struct s5p_cec_dev *cec;
|
||||||
bool needs_hpd = of_property_read_bool(pdev->dev.of_node, "needs-hpd");
|
bool needs_hpd = of_property_read_bool(pdev->dev.of_node, "needs-hpd");
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -212,8 +211,7 @@ static int s5p_cec_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(cec->pmu))
|
if (IS_ERR(cec->pmu))
|
||||||
return -EPROBE_DEFER;
|
return -EPROBE_DEFER;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
cec->reg = devm_platform_ioremap_resource(pdev, 0);
|
||||||
cec->reg = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(cec->reg))
|
if (IS_ERR(cec->reg))
|
||||||
return PTR_ERR(cec->reg);
|
return PTR_ERR(cec->reg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue