diff options
author | Dafna Hirschfeld <[email protected]> | 2019-10-07 10:50:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2019-10-24 19:00:14 -0300 |
commit | 4996992c4f7410e9a43aa3047e8034756cece21a (patch) | |
tree | b23b4fb3657ca9bf3a7c18f83d77ed463c8022ce | |
parent | 817d0b3278f52d4d20b9706e41c808287ee909e4 (diff) |
media: vimc: cleanup code that assigns entity in entities array
Since the add callback returns NULL on failure and the array
is initialized to NULLs, there is no need for the intermediate
assignment to local var.
Signed-off-by: Dafna Hirschfeld <[email protected]>
Acked-by: Helen Koike <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/platform/vimc/vimc-core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index 65048bd7d80b..97a272f3350a 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -160,19 +160,17 @@ err_rm_links: static int vimc_add_subdevs(struct vimc_device *vimc) { unsigned int i; - struct vimc_ent_device *ved; for (i = 0; i < vimc->pipe_cfg->num_ents; i++) { dev_dbg(&vimc->pdev.dev, "new entity for %s\n", vimc->pipe_cfg->ents[i].name); - ved = vimc->pipe_cfg->ents[i].add(vimc, + vimc->ent_devs[i] = vimc->pipe_cfg->ents[i].add(vimc, vimc->pipe_cfg->ents[i].name); - if (!ved) { + if (!vimc->ent_devs[i]) { dev_err(&vimc->pdev.dev, "add new entity for %s\n", vimc->pipe_cfg->ents[i].name); return -EINVAL; } - vimc->ent_devs[i] = ved; } return 0; } |