From patchwork Thu Oct 3 10:44:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11172489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 084781902 for ; Thu, 3 Oct 2019 10:45:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E432721A4C for ; Thu, 3 Oct 2019 10:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729551AbfJCKpE (ORCPT ); Thu, 3 Oct 2019 06:45:04 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39394 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfJCKpE (ORCPT ); Thu, 3 Oct 2019 06:45:04 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id B45A328FA8F From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH v2 1/5] media: vimc: initialize vim entity pointers to NULL Date: Thu, 3 Oct 2019 12:44:05 +0200 Message-Id: <20191003104409.15756-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> References: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org since NULL value for vimc entity pointer indicates that entity creation failed and this is tested, the pointers should be initialized to NULL. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/media/platform/vimc/vimc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index 6e3e5c91ae39..b8add4087652 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -199,9 +199,8 @@ static int vimc_register_devices(struct vimc_device *vimc) } /* allocate ent_devs */ - vimc->ent_devs = kmalloc_array(vimc->pipe_cfg->num_ents, - sizeof(*vimc->ent_devs), - GFP_KERNEL); + vimc->ent_devs = kcalloc(vimc->pipe_cfg->num_ents, + sizeof(*vimc->ent_devs), GFP_KERNEL); if (!vimc->ent_devs) goto err_v4l2_unregister; From patchwork Thu Oct 3 10:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11172491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BED117EE for ; Thu, 3 Oct 2019 10:45:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19165222C2 for ; Thu, 3 Oct 2019 10:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729557AbfJCKpF (ORCPT ); Thu, 3 Oct 2019 06:45:05 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39402 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfJCKpF (ORCPT ); Thu, 3 Oct 2019 06:45:05 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id A303628FA90 From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH v2 2/5] media: vimc: cleanup code that assigns entity in entities array Date: Thu, 3 Oct 2019 12:44:06 +0200 Message-Id: <20191003104409.15756-3-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> References: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Acked-by: Helen Koike --- drivers/media/platform/vimc/vimc-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index b8add4087652..325f55d0d8b3 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -160,19 +160,17 @@ static int vimc_create_links(struct vimc_device *vimc) 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; } From patchwork Thu Oct 3 10:44:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11172493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 201651709 for ; Thu, 3 Oct 2019 10:45:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2A8E21A4C for ; Thu, 3 Oct 2019 10:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729566AbfJCKpH (ORCPT ); Thu, 3 Oct 2019 06:45:07 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39410 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfJCKpH (ORCPT ); Thu, 3 Oct 2019 06:45:07 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id C7D9F28FA91 From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH v2 3/5] media: vimc: sensor: register subdevice only after initialization Date: Thu, 3 Oct 2019 12:44:07 +0200 Message-Id: <20191003104409.15756-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> References: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org vimc_sen_add function first registers the subdevice and then calls tpg_alloc. If tpg_alloc fails it unregisters the subdevice and then frees vsen, this cause double free since the release callback that follows subdevice unregistration also frees vsen. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/media/platform/vimc/vimc-sensor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index 46dc6a535abe..ee2306c08569 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -358,6 +358,13 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, goto err_free_vsen; } + /* Initialize the test pattern generator */ + tpg_init(&vsen->tpg, vsen->mbus_format.width, + vsen->mbus_format.height); + ret = tpg_alloc(&vsen->tpg, VIMC_FRAME_MAX_WIDTH); + if (ret) + goto err_free_hdl; + /* Initialize ved and sd */ ret = vimc_ent_sd_register(&vsen->ved, &vsen->sd, v4l2_dev, vcfg_name, @@ -365,7 +372,7 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, (const unsigned long[1]) {MEDIA_PAD_FL_SOURCE}, &vimc_sen_int_ops, &vimc_sen_ops); if (ret) - goto err_free_hdl; + goto err_free_tpg; vsen->ved.process_frame = vimc_sen_process_frame; vsen->dev = &vimc->pdev.dev; @@ -373,17 +380,10 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, /* Initialize the frame format */ vsen->mbus_format = fmt_default; - /* Initialize the test pattern generator */ - tpg_init(&vsen->tpg, vsen->mbus_format.width, - vsen->mbus_format.height); - ret = tpg_alloc(&vsen->tpg, VIMC_FRAME_MAX_WIDTH); - if (ret) - goto err_unregister_ent_sd; - return &vsen->ved; -err_unregister_ent_sd: - vimc_ent_sd_unregister(&vsen->ved, &vsen->sd); +err_free_tpg: + tpg_free(&vsen->tpg); err_free_hdl: v4l2_ctrl_handler_free(&vsen->hdl); err_free_vsen: From patchwork Thu Oct 3 10:44:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11172495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3896817EE for ; Thu, 3 Oct 2019 10:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21C5721848 for ; Thu, 3 Oct 2019 10:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729578AbfJCKpI (ORCPT ); Thu, 3 Oct 2019 06:45:08 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39422 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729560AbfJCKpI (ORCPT ); Thu, 3 Oct 2019 06:45:08 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 1A0B028FA9C From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH v2 4/5] media: vimc: move media_entity_cleanup to release callbacks Date: Thu, 3 Oct 2019 12:44:08 +0200 Message-Id: <20191003104409.15756-5-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> References: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org according to the docs, this function must be called during the cleanup phase after unregistering the entity. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/media/platform/vimc/vimc-capture.c | 2 +- drivers/media/platform/vimc/vimc-common.c | 1 - drivers/media/platform/vimc/vimc-debayer.c | 1 + drivers/media/platform/vimc/vimc-scaler.c | 1 + drivers/media/platform/vimc/vimc-sensor.c | 1 + 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c index 602f80323031..5f353c20e605 100644 --- a/drivers/media/platform/vimc/vimc-capture.c +++ b/drivers/media/platform/vimc/vimc-capture.c @@ -330,6 +330,7 @@ static void vimc_cap_release(struct video_device *vdev) struct vimc_cap_device *vcap = container_of(vdev, struct vimc_cap_device, vdev); + media_entity_cleanup(vcap->ved.ent); vimc_pads_cleanup(vcap->ved.pads); kfree(vcap); } @@ -340,7 +341,6 @@ void vimc_cap_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) vcap = container_of(ved, struct vimc_cap_device, ved); vb2_queue_release(&vcap->queue); - media_entity_cleanup(ved->ent); video_unregister_device(&vcap->vdev); } diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index a3120f4f7a90..999bc353fb10 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c @@ -423,7 +423,6 @@ EXPORT_SYMBOL_GPL(vimc_ent_sd_register); void vimc_ent_sd_unregister(struct vimc_ent_device *ved, struct v4l2_subdev *sd) { - media_entity_cleanup(ved->ent); v4l2_device_unregister_subdev(sd); } EXPORT_SYMBOL_GPL(vimc_ent_sd_unregister); diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c index feac47d79449..e1bad6713cde 100644 --- a/drivers/media/platform/vimc/vimc-debayer.c +++ b/drivers/media/platform/vimc/vimc-debayer.c @@ -477,6 +477,7 @@ static void vimc_deb_release(struct v4l2_subdev *sd) struct vimc_deb_device *vdeb = container_of(sd, struct vimc_deb_device, sd); + media_entity_cleanup(vdeb->ved.ent); vimc_pads_cleanup(vdeb->ved.pads); kfree(vdeb); } diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c index a6a3cc5be872..1982bc089af5 100644 --- a/drivers/media/platform/vimc/vimc-scaler.c +++ b/drivers/media/platform/vimc/vimc-scaler.c @@ -336,6 +336,7 @@ static void vimc_sca_release(struct v4l2_subdev *sd) struct vimc_sca_device *vsca = container_of(sd, struct vimc_sca_device, sd); + media_entity_cleanup(vsca->ved.ent); vimc_pads_cleanup(vsca->ved.pads); kfree(vsca); } diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index ee2306c08569..63fe024ccea5 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -291,6 +291,7 @@ static void vimc_sen_release(struct v4l2_subdev *sd) v4l2_ctrl_handler_free(&vsen->hdl); tpg_free(&vsen->tpg); + media_entity_cleanup(vsen->ved.ent); vimc_pads_cleanup(vsen->ved.pads); kfree(vsen); } From patchwork Thu Oct 3 10:44:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11172497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F02617EE for ; Thu, 3 Oct 2019 10:45:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85F3221A4C for ; Thu, 3 Oct 2019 10:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729580AbfJCKpK (ORCPT ); Thu, 3 Oct 2019 06:45:10 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39426 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfJCKpJ (ORCPT ); Thu, 3 Oct 2019 06:45:09 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id EBE6128FA92 From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH v2 5/5] media: vimc: remove the helper function vimc_ent_sd_unregister Date: Thu, 3 Oct 2019 12:44:09 +0200 Message-Id: <20191003104409.15756-6-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> References: <20191003104409.15756-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org since this function only calls v4l2_device_unregister_subdev, it is pointless. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/media/platform/vimc/vimc-common.c | 5 ----- drivers/media/platform/vimc/vimc-common.h | 12 ------------ drivers/media/platform/vimc/vimc-debayer.c | 2 +- drivers/media/platform/vimc/vimc-scaler.c | 2 +- drivers/media/platform/vimc/vimc-sensor.c | 2 +- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index 999bc353fb10..67b53dc1849d 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c @@ -421,8 +421,3 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved, } EXPORT_SYMBOL_GPL(vimc_ent_sd_register); -void vimc_ent_sd_unregister(struct vimc_ent_device *ved, struct v4l2_subdev *sd) -{ - v4l2_device_unregister_subdev(sd); -} -EXPORT_SYMBOL_GPL(vimc_ent_sd_unregister); diff --git a/drivers/media/platform/vimc/vimc-common.h b/drivers/media/platform/vimc/vimc-common.h index 698db7c07645..af5b1166dc1f 100644 --- a/drivers/media/platform/vimc/vimc-common.h +++ b/drivers/media/platform/vimc/vimc-common.h @@ -251,18 +251,6 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved, const struct v4l2_subdev_internal_ops *sd_int_ops, const struct v4l2_subdev_ops *sd_ops); -/** - * vimc_ent_sd_unregister - cleanup and unregister a subdev node - * - * @ved: the vimc_ent_device struct to be cleaned up - * @sd: the v4l2_subdev struct to be unregistered - * - * Helper function cleanup and unregister the struct vimc_ent_device and struct - * v4l2_subdev which represents a subdev node in the topology - */ -void vimc_ent_sd_unregister(struct vimc_ent_device *ved, - struct v4l2_subdev *sd); - /** * vimc_link_validate - validates a media link * diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c index e1bad6713cde..4e5316c671e0 100644 --- a/drivers/media/platform/vimc/vimc-debayer.c +++ b/drivers/media/platform/vimc/vimc-debayer.c @@ -491,7 +491,7 @@ void vimc_deb_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) struct vimc_deb_device *vdeb; vdeb = container_of(ved, struct vimc_deb_device, ved); - vimc_ent_sd_unregister(ved, &vdeb->sd); + v4l2_device_unregister_subdev(&vdeb->sd); } struct vimc_ent_device *vimc_deb_add(struct vimc_device *vimc, diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c index 1982bc089af5..4fe2ba578652 100644 --- a/drivers/media/platform/vimc/vimc-scaler.c +++ b/drivers/media/platform/vimc/vimc-scaler.c @@ -350,7 +350,7 @@ void vimc_sca_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) struct vimc_sca_device *vsca; vsca = container_of(ved, struct vimc_sca_device, ved); - vimc_ent_sd_unregister(ved, &vsca->sd); + v4l2_device_unregister_subdev(&vsca->sd); } struct vimc_ent_device *vimc_sca_add(struct vimc_device *vimc, diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index 63fe024ccea5..14838362d871 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -305,7 +305,7 @@ void vimc_sen_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) struct vimc_sen_device *vsen; vsen = container_of(ved, struct vimc_sen_device, ved); - vimc_ent_sd_unregister(ved, &vsen->sd); + v4l2_device_unregister_subdev(&vsen->sd); } /* Image Processing Controls */