Skip to content

Commit

Permalink
Merge tag 'topic/drm-misc-2016-07-28' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm-intel into drm-next

A few more simple fixes that Sean&I collected. There's a bunch of bigger
things on dri-devel, but I think those are all too late for 4.8 really.
I'll try and go collect them after -rc1 for 4.9.

* tag 'topic/drm-misc-2016-07-28' of git://anongit.freedesktop.org/drm-intel:
  drm/arm: mali-dp: Fix error return code in malidp_bind()
  drm/arm: mali-dp: Remove redundant dev_err call in malidp_bind()
  drm/gma500: remove unnecessary stub for fb_ioctl()
  apple-gmux: Sphinxify docs
  drm/arm: mali-dp: Set crtc.port to the port instead of the endpoint
  drm/sti: use new Reset API
  drm/etnaviv: Optimize error handling in etnaviv_gem_new_userptr()
  drm/etnaviv: Delete unnecessary checks before two function calls
  drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
  drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
  drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
  drm/bridge: ps8622: Delete an unnecessary check before backlight_device_unregister()
  GPU-DRM-GMA500: Delete unnecessary checks before two function calls
  GPU-DRM-OMAP: Delete unnecessary checks before two function calls
  • Loading branch information
airlied committed Jul 29, 2016
2 parents a1f5524 + 12ae57a commit e470f3a
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 86 deletions.
19 changes: 13 additions & 6 deletions drivers/gpu/drm/arm/malidp_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ static int malidp_bind(struct device *dev)
{
struct resource *res;
struct drm_device *drm;
struct device_node *ep;
struct malidp_drm *malidp;
struct malidp_hw_device *hwdev;
struct platform_device *pdev = to_platform_device(dev);
Expand Down Expand Up @@ -284,10 +285,8 @@ static int malidp_bind(struct device *dev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hwdev->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(hwdev->regs)) {
DRM_ERROR("Failed to map control registers area\n");
if (IS_ERR(hwdev->regs))
return PTR_ERR(hwdev->regs);
}

hwdev->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(hwdev->pclk))
Expand Down Expand Up @@ -360,11 +359,14 @@ static int malidp_bind(struct device *dev)
goto register_fail;

/* Set the CRTC's port so that the encoder component can find it */
malidp->crtc.port = of_graph_get_next_endpoint(dev->of_node, NULL);
ep = of_graph_get_next_endpoint(dev->of_node, NULL);
if (!ep) {
ret = -EINVAL;
goto port_fail;
}
malidp->crtc.port = of_get_next_parent(ep);

ret = component_bind_all(dev, drm);
of_node_put(malidp->crtc.port);

if (ret) {
DRM_ERROR("Failed to bind all components\n");
goto bind_fail;
Expand Down Expand Up @@ -402,6 +404,9 @@ static int malidp_bind(struct device *dev)
irq_init_fail:
component_unbind_all(dev, drm);
bind_fail:
of_node_put(malidp->crtc.port);
malidp->crtc.port = NULL;
port_fail:
drm_dev_unregister(drm);
register_fail:
malidp_de_planes_destroy(drm);
Expand Down Expand Up @@ -435,6 +440,8 @@ static void malidp_unbind(struct device *dev)
malidp_de_irq_fini(drm);
drm_vblank_cleanup(drm);
component_unbind_all(dev, drm);
of_node_put(malidp->crtc.port);
malidp->crtc.port = NULL;
drm_dev_unregister(drm);
malidp_de_planes_destroy(drm);
drm_mode_config_cleanup(drm);
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/bridge/parade-ps8622.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,7 @@ static int ps8622_remove(struct i2c_client *client)
{
struct ps8622_bridge *ps8622 = i2c_get_clientdata(client);

if (ps8622->bl)
backlight_device_unregister(ps8622->bl);

backlight_device_unregister(ps8622->bl);
drm_bridge_remove(&ps8622->bridge);

return 0;
Expand Down
16 changes: 5 additions & 11 deletions drivers/gpu/drm/etnaviv/etnaviv_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv,

static void etnaviv_gem_shmem_release(struct etnaviv_gem_object *etnaviv_obj)
{
if (etnaviv_obj->vaddr)
vunmap(etnaviv_obj->vaddr);
vunmap(etnaviv_obj->vaddr);
put_pages(etnaviv_obj);
}

Expand Down Expand Up @@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
return obj;

fail:
if (obj)
drm_gem_object_unreference_unlocked(obj);

drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
}

Expand Down Expand Up @@ -916,15 +913,12 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file,
get_task_struct(current);

ret = etnaviv_gem_obj_add(dev, &etnaviv_obj->base);
if (ret) {
drm_gem_object_unreference_unlocked(&etnaviv_obj->base);
return ret;
}
if (ret)
goto unreference;

ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle);

unreference:
/* drop reference from allocate - handle holds it now */
drm_gem_object_unreference_unlocked(&etnaviv_obj->base);

return ret;
}
3 changes: 1 addition & 2 deletions drivers/gpu/drm/gma500/cdv_intel_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);

if (gma_encoder->i2c_bus)
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
Expand Down
9 changes: 3 additions & 6 deletions drivers/gpu/drm/gma500/cdv_intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);

if (gma_encoder->i2c_bus)
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
Expand Down Expand Up @@ -780,12 +779,10 @@ void cdv_intel_lvds_init(struct drm_device *dev,
failed_find:
mutex_unlock(&dev->mode_config.mutex);
printk(KERN_ERR "Failed find\n");
if (gma_encoder->ddc_bus)
psb_intel_i2c_destroy(gma_encoder->ddc_bus);
psb_intel_i2c_destroy(gma_encoder->ddc_bus);
failed_ddc:
printk(KERN_ERR "Failed DDC\n");
if (gma_encoder->i2c_bus)
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
psb_intel_i2c_destroy(gma_encoder->i2c_bus);
failed_blc_i2c:
printk(KERN_ERR "Failed BLC\n");
drm_encoder_cleanup(encoder);
Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/gma500/framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
return 0;
}

static int psbfb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
return -ENOTTY;
}

static struct fb_ops psbfb_ops = {
.owner = THIS_MODULE,
.fb_check_var = drm_fb_helper_check_var,
Expand All @@ -201,7 +195,6 @@ static struct fb_ops psbfb_ops = {
.fb_imageblit = drm_fb_helper_cfb_imageblit,
.fb_mmap = psbfb_mmap,
.fb_sync = psbfb_sync,
.fb_ioctl = psbfb_ioctl,
};

static struct fb_ops psbfb_roll_ops = {
Expand All @@ -215,7 +208,6 @@ static struct fb_ops psbfb_roll_ops = {
.fb_imageblit = drm_fb_helper_cfb_imageblit,
.fb_pan_display = psbfb_pan,
.fb_mmap = psbfb_mmap,
.fb_ioctl = psbfb_ioctl,
};

static struct fb_ops psbfb_unaccel_ops = {
Expand All @@ -228,7 +220,6 @@ static struct fb_ops psbfb_unaccel_ops = {
.fb_copyarea = drm_fb_helper_cfb_copyarea,
.fb_imageblit = drm_fb_helper_cfb_imageblit,
.fb_mmap = psbfb_mmap,
.fb_ioctl = psbfb_ioctl,
};

/**
Expand Down
6 changes: 2 additions & 4 deletions drivers/gpu/drm/gma500/psb_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@ static int psb_driver_unload(struct drm_device *dev)
iounmap(dev_priv->aux_reg);
dev_priv->aux_reg = NULL;
}
if (dev_priv->aux_pdev)
pci_dev_put(dev_priv->aux_pdev);
if (dev_priv->lpc_pdev)
pci_dev_put(dev_priv->lpc_pdev);
pci_dev_put(dev_priv->aux_pdev);
pci_dev_put(dev_priv->lpc_pdev);

/* Destroy VBT data */
psb_intel_destroy_bios(dev);
Expand Down
9 changes: 3 additions & 6 deletions drivers/gpu/drm/gma500/psb_intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;

if (lvds_priv->ddc_bus)
psb_intel_i2c_destroy(lvds_priv->ddc_bus);
psb_intel_i2c_destroy(lvds_priv->ddc_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
Expand Down Expand Up @@ -835,11 +834,9 @@ void psb_intel_lvds_init(struct drm_device *dev,

failed_find:
mutex_unlock(&dev->mode_config.mutex);
if (lvds_priv->ddc_bus)
psb_intel_i2c_destroy(lvds_priv->ddc_bus);
psb_intel_i2c_destroy(lvds_priv->ddc_bus);
failed_ddc:
if (lvds_priv->i2c_bus)
psb_intel_i2c_destroy(lvds_priv->i2c_bus);
psb_intel_i2c_destroy(lvds_priv->i2c_bus);
failed_blc_i2c:
drm_encoder_cleanup(encoder);
drm_connector_cleanup(connector);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/mgag200/mgag200_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct mga_framebuffer *mga_fb = to_mga_framebuffer(fb);
if (mga_fb->obj)
drm_gem_object_unreference_unlocked(mga_fb->obj);

drm_gem_object_unreference_unlocked(mga_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,7 @@ static int dsicm_probe(struct platform_device *pdev)
return 0;

err_sysfs_create:
if (bldev != NULL)
backlight_device_unregister(bldev);
backlight_device_unregister(bldev);
err_bl:
destroy_workqueue(ddata->workqueue);
err_reg:
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/omapdrm/omap_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb)

for (i = 0; i < n; i++) {
struct plane *plane = &omap_fb->planes[i];
if (plane->bo)
drm_gem_object_unreference_unlocked(plane->bo);

drm_gem_object_unreference_unlocked(plane->bo);
}

kfree(omap_fb);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/qxl/qxl_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@ void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);

if (qxl_fb->obj)
drm_gem_object_unreference_unlocked(qxl_fb->obj);
drm_gem_object_unreference_unlocked(qxl_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(qxl_fb);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/sti/sti_compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ static int sti_compositor_probe(struct platform_device *pdev)
}

/* Get reset resources */
compo->rst_main = devm_reset_control_get(dev, "compo-main");
compo->rst_main = devm_reset_control_get_shared(dev, "compo-main");
/* Take compo main out of reset */
if (!IS_ERR(compo->rst_main))
reset_control_deassert(compo->rst_main);

compo->rst_aux = devm_reset_control_get(dev, "compo-aux");
compo->rst_aux = devm_reset_control_get_shared(dev, "compo-aux");
/* Take compo aux out of reset */
if (!IS_ERR(compo->rst_aux))
reset_control_deassert(compo->rst_aux);
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3625,9 +3625,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context,
(sw_context->cmd_bounce_size >> 1));
}

if (sw_context->cmd_bounce != NULL)
vfree(sw_context->cmd_bounce);

vfree(sw_context->cmd_bounce);
sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);

if (sw_context->cmd_bounce == NULL) {
Expand Down
Loading

0 comments on commit e470f3a

Please sign in to comment.