mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
drm/mediatek: Use devm_platform_ioremap_resource()
Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230412064635.41315-1-yang.lee@linux.alibaba.com/ Link: https://patchwork.kernel.org/project/dri-devel/patch/20230412064635.41315-2-yang.lee@linux.alibaba.com/ Link: https://patchwork.kernel.org/project/dri-devel/patch/20230412064635.41315-3-yang.lee@linux.alibaba.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
This commit is contained in:
parent
b85ea95d08
commit
3e743b0fcb
@ -185,7 +185,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct mtk_cec *cec;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
|
||||
@ -195,8 +194,7 @@ static int mtk_cec_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, cec);
|
||||
spin_lock_init(&cec->lock);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
cec->regs = devm_ioremap_resource(dev, res);
|
||||
cec->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(cec->regs)) {
|
||||
ret = PTR_ERR(cec->regs);
|
||||
dev_err(dev, "Failed to ioremap cec: %d\n", ret);
|
||||
|
@ -168,7 +168,6 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct mtk_disp_aal *priv;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
@ -181,8 +180,7 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(priv->clk);
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->regs = devm_ioremap_resource(dev, res);
|
||||
priv->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(priv->regs)) {
|
||||
dev_err(dev, "failed to ioremap aal\n");
|
||||
return PTR_ERR(priv->regs);
|
||||
|
@ -153,7 +153,6 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct mtk_disp_ccorr *priv;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
@ -166,8 +165,7 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(priv->clk);
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->regs = devm_ioremap_resource(dev, res);
|
||||
priv->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(priv->regs)) {
|
||||
dev_err(dev, "failed to ioremap ccorr\n");
|
||||
return PTR_ERR(priv->regs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user