Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333778
b: refs/heads/master
c: 01b1d97
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 6, 2012
1 parent 09280ee commit a5dbfd7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6067f8b1e3edd731cbcffb642d166d81767a30a
refs/heads/master: 01b1d975597dd051515fe90e5b0b09cc700e6aa0
33 changes: 20 additions & 13 deletions trunk/drivers/media/platform/davinci/vpif_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,8 @@ static __init int vpif_probe(struct platform_device *pdev)
{
struct vpif_subdev_info *subdevdata;
struct vpif_display_config *config;
int i, j = 0, k, q, m, err = 0;
int i, j = 0, k, err = 0;
int res_idx = 0;
struct i2c_adapter *i2c_adap;
struct common_obj *common;
struct channel_obj *ch;
Expand All @@ -1630,21 +1631,22 @@ static __init int vpif_probe(struct platform_device *pdev)
return err;
}

k = 0;
while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, k))) {
while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) {
for (i = res->start; i <= res->end; i++) {
if (request_irq(i, vpif_channel_isr, IRQF_SHARED,
"VPIF_Display",
(void *)(&vpif_obj.dev[k]->channel_id))) {
"VPIF_Display", (void *)
(&vpif_obj.dev[res_idx]->channel_id))) {
err = -EBUSY;
for (j = 0; j < i; j++)
free_irq(j, (void *)
(&vpif_obj.dev[res_idx]->channel_id));
goto vpif_int_err;
}
}
k++;
res_idx++;
}

for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {

/* Get the pointer to the channel object */
ch = vpif_obj.dev[i];

Expand Down Expand Up @@ -1699,7 +1701,7 @@ static __init int vpif_probe(struct platform_device *pdev)
if (vpif_obj.sd == NULL) {
vpif_err("unable to allocate memory for subdevice pointers\n");
err = -ENOMEM;
goto vpif_int_err;
goto vpif_sd_error;
}

for (i = 0; i < subdev_count; i++) {
Expand Down Expand Up @@ -1776,14 +1778,19 @@ static __init int vpif_probe(struct platform_device *pdev)
}
probe_subdev_out:
kfree(vpif_obj.sd);
vpif_sd_error:
for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {
ch = vpif_obj.dev[i];
/* Note: does nothing if ch->video_dev == NULL */
video_device_release(ch->video_dev);
}
vpif_int_err:
v4l2_device_unregister(&vpif_obj.v4l2_dev);
vpif_err("VPIF IRQ request failed\n");
for (q = k; k >= 0; k--) {
for (m = i; m >= res->start; m--)
free_irq(m, (void *)(&vpif_obj.dev[k]->channel_id));
res = platform_get_resource(pdev, IORESOURCE_IRQ, k-1);
m = res->end;
for (i = 0; i < res_idx; i++) {
res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
for (j = res->start; j <= res->end; j++)
free_irq(j, (void *)(&vpif_obj.dev[i]->channel_id));
}

return err;
Expand Down

0 comments on commit a5dbfd7

Please sign in to comment.