Two cleanups

- Simply use dev_err_probe() instead of returning -EPROBE_DEFER.
 - Drop drm_parms allocation and deallocation code which aren't needed.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJfabWnAAoJEFc4NIkMQxK4d4oP/2MgEbEeeNDkiv2DnZeZLuee
 4VFx9gqteuboz7I1oYLufXm9xOIL3Y7CqGkQnNjPQWCNt6UhxXujrCYRBaWBJ+OR
 3Ck2+DIH5xsfwL+U1XIhQnPACTf/wFZHAsAc4Xk8ABaxgegNrI+0mUu+7HCXsYkw
 4SEplBSv5UE0R3qV02E3o1GYxCZHQrFfjfdTm6RTLA24z+g8q+6/2JFJxFRYOHGB
 cHnuzQwWTfulXHM34HmwTBxd6dtWTP2iE8P+0Sw+/+h58EQCIkFK/rdFGYudQ9Tu
 oCmTcV/EB7OT1yWpuhuvXJp06hEIMjIMp+uWj895amCYgRl2CIfCtNYnT2vOSSjq
 cjHzXL1pbFuVN4n4lPxKGop2wK1FQzi3NtwSKWsvezTXbYoPDJJ0GyNn4avp6rA+
 RvaUfCmLM14DWyi7xI55DT6BUkAk+UtgvgGuOyGjXm8BSsB72zgLq9OBeszbxfO2
 DoP20jdyA6cjIod5wLnqkFNxylX4h9RJoVEt7oryRNqGUuQ0u3aNSVzMFBZ59sc7
 olOqWd/4Y/NyFt3JBuConr31Z9V0XPD+r/BFlchrRhsfYSil1PyqQPbMJayyNQEi
 YifZBtkzgqb9XVx4PBEFKY57SEzWvfkEJ7pYym3j91/rpOu433FR/AE48ui4Dons
 cKeNCPrsneQR/h0/AubY
 =mQLm
 -----END PGP SIGNATURE-----

Merge tag 'exynos-drm-next-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Two cleanups
- Simply use dev_err_probe() instead of returning -EPROBE_DEFER.
- Drop drm_parms allocation and deallocation code which aren't needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Inki Dae <inki.dae@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1600763939-20032-1-git-send-email-inki.dae@samsung.com
This commit is contained in:
Dave Airlie 2020-09-23 08:38:08 +10:00
commit 1cd0f49410
3 changed files with 5 additions and 36 deletions

View File

@ -31,23 +31,6 @@
#define EXYNOS_DEV_ADDR_START 0x20000000
#define EXYNOS_DEV_ADDR_SIZE 0x40000000
static inline int configure_dma_max_seg_size(struct device *dev)
{
if (!dev->dma_parms)
dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
return 0;
}
static inline void clear_dma_max_seg_size(struct device *dev)
{
kfree(dev->dma_parms);
dev->dma_parms = NULL;
}
/*
* drm_iommu_attach_device- attach device to iommu mapping
*
@ -69,10 +52,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
return -EINVAL;
}
ret = configure_dma_max_seg_size(subdrv_dev);
if (ret)
return ret;
dma_set_max_seg_size(subdrv_dev, DMA_BIT_MASK(32));
if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
/*
* Keep the original DMA mapping of the sub-device and
@ -89,9 +69,6 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
ret = iommu_attach_device(priv->mapping, subdrv_dev);
}
if (ret)
clear_dma_max_seg_size(subdrv_dev);
return ret;
}
@ -114,8 +91,6 @@ static void drm_iommu_detach_device(struct drm_device *drm_dev,
arm_iommu_attach_device(subdrv_dev, *dma_priv);
} else if (IS_ENABLED(CONFIG_IOMMU_DMA))
iommu_detach_device(priv->mapping, subdrv_dev);
clear_dma_max_seg_size(subdrv_dev);
}
int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,

View File

@ -1760,11 +1760,8 @@ static int exynos_dsi_probe(struct platform_device *pdev)
dsi->supplies[1].supply = "vddio";
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
dsi->supplies);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_info(dev, "failed to get regulators: %d\n", ret);
return ret;
}
if (ret)
return dev_err_probe(dev, ret, "failed to get regulators\n");
dsi->clks = devm_kcalloc(dev,
dsi->driver_data->num_clks, sizeof(*dsi->clks),

View File

@ -1797,11 +1797,8 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
hdata->regul_bulk[i].supply = supply[i];
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(supply), hdata->regul_bulk);
if (ret) {
if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to get regulators\n");
return ret;
}
if (ret)
return dev_err_probe(dev, ret, "failed to get regulators\n");
hdata->reg_hdmi_en = devm_regulator_get_optional(dev, "hdmi-en");