mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 16:14:13 +08:00
drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname()
Convert platform_get_resource_byname() + devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does. Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
55354ee7dc
commit
9bde3bfe24
@ -1228,7 +1228,6 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
|
|||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dpsub->dev);
|
struct platform_device *pdev = to_platform_device(dpsub->dev);
|
||||||
struct zynqmp_disp *disp;
|
struct zynqmp_disp *disp;
|
||||||
struct resource *res;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
disp = kzalloc(sizeof(*disp), GFP_KERNEL);
|
disp = kzalloc(sizeof(*disp), GFP_KERNEL);
|
||||||
@ -1238,22 +1237,19 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
|
|||||||
disp->dev = &pdev->dev;
|
disp->dev = &pdev->dev;
|
||||||
disp->dpsub = dpsub;
|
disp->dpsub = dpsub;
|
||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "blend");
|
disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend");
|
||||||
disp->blend.base = devm_ioremap_resource(disp->dev, res);
|
|
||||||
if (IS_ERR(disp->blend.base)) {
|
if (IS_ERR(disp->blend.base)) {
|
||||||
ret = PTR_ERR(disp->blend.base);
|
ret = PTR_ERR(disp->blend.base);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "av_buf");
|
disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf");
|
||||||
disp->avbuf.base = devm_ioremap_resource(disp->dev, res);
|
|
||||||
if (IS_ERR(disp->avbuf.base)) {
|
if (IS_ERR(disp->avbuf.base)) {
|
||||||
ret = PTR_ERR(disp->avbuf.base);
|
ret = PTR_ERR(disp->avbuf.base);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aud");
|
disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud");
|
||||||
disp->audio.base = devm_ioremap_resource(disp->dev, res);
|
|
||||||
if (IS_ERR(disp->audio.base)) {
|
if (IS_ERR(disp->audio.base)) {
|
||||||
ret = PTR_ERR(disp->audio.base);
|
ret = PTR_ERR(disp->audio.base);
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user