diff --git a/msm/dp/dp_hpd.c b/msm/dp/dp_hpd.c index efeba7072a..72af24fd56 100644 --- a/msm/dp/dp_hpd.c +++ b/msm/dp/dp_hpd.c @@ -46,21 +46,21 @@ struct dp_hpd *dp_hpd_get(struct device *dev, struct dp_parser *parser, if (parser->no_aux_switch && parser->lphw_hpd) { dp_hpd = dp_lphw_hpd_get(dev, parser, catalog, cb); - if (IS_ERR(dp_hpd)) { + if (IS_ERR_OR_NULL(dp_hpd)) { DP_ERR("failed to get lphw hpd\n"); return dp_hpd; } dp_hpd->type = DP_HPD_LPHW; } else if (parser->no_aux_switch) { dp_hpd = dp_gpio_hpd_get(dev, cb); - if (IS_ERR(dp_hpd)) { + if (IS_ERR_OR_NULL(dp_hpd)) { DP_ERR("failed to get gpio hpd\n"); return dp_hpd; } dp_hpd->type = DP_HPD_GPIO; } else { dp_hpd = dp_altmode_get(dev, cb); - if (!IS_ERR(dp_hpd)) { + if (!IS_ERR_OR_NULL(dp_hpd)) { dp_hpd->type = DP_HPD_ALTMODE; goto config; } @@ -68,7 +68,7 @@ struct dp_hpd *dp_hpd_get(struct device *dev, struct dp_parser *parser, PTR_ERR(dp_hpd)); dp_hpd = dp_usbpd_get(dev, cb); - if (IS_ERR(dp_hpd)) { + if (IS_ERR_OR_NULL(dp_hpd)) { DP_ERR("failed to get usbpd\n"); return dp_hpd; } diff --git a/msm/msm_gem.c b/msm/msm_gem.c index 4986eb1c24..3162f913ba 100644 --- a/msm/msm_gem.c +++ b/msm/msm_gem.c @@ -114,8 +114,14 @@ static struct page **get_pages(struct drm_gem_object *obj) */ if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) { aspace_dev = msm_gem_get_aspace_device(msm_obj->aspace); - dma_map_sg(aspace_dev, msm_obj->sgt->sgl, - msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + if (aspace_dev) + dma_map_sg(aspace_dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, + DMA_BIDIRECTIONAL); + else + dev_err(dev->dev, + "failed to get aspace_device\n"); + } } @@ -190,8 +196,12 @@ void msm_gem_sync(struct drm_gem_object *obj) * scatter/gather mapping for the CPU and device. */ aspace_dev = msm_gem_get_aspace_device(msm_obj->aspace); - dma_sync_sg_for_device(aspace_dev, msm_obj->sgt->sgl, - msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + if (aspace_dev) + dma_sync_sg_for_device(aspace_dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + else + dev_err(obj->dev->dev, + "failed to get aspace_device\n"); } diff --git a/msm/sde/sde_encoder_phys_cmd.c b/msm/sde/sde_encoder_phys_cmd.c index 7624fc4926..2304665003 100644 --- a/msm/sde/sde_encoder_phys_cmd.c +++ b/msm/sde/sde_encoder_phys_cmd.c @@ -321,10 +321,10 @@ static void _sde_encoder_phys_cmd_setup_irq_hw_idx( struct sde_encoder_phys *phys_enc) { struct sde_encoder_irq *irq; - struct sde_kms *sde_kms = phys_enc->sde_kms; + struct sde_kms *sde_kms; int ret = 0; - if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_ctl) { + if (!phys_enc->sde_kms || !phys_enc->hw_pp || !phys_enc->hw_ctl) { SDE_ERROR("invalid args %d %d\n", !phys_enc, phys_enc ? !phys_enc->hw_pp : 0); return; @@ -335,6 +335,8 @@ static void _sde_encoder_phys_cmd_setup_irq_hw_idx( return; } + sde_kms = phys_enc->sde_kms; + mutex_lock(&sde_kms->vblank_ctl_global_lock); if (atomic_read(&phys_enc->vblank_refcount)) {