LKML Archive on
help / color / mirror / Atom feed
From: Christophe JAILLET <>
	Christophe JAILLET <>,,,
Subject: [PATCH 3/3] media: staging: atomisp: Fix usage of 'media_entity_cleanup()'
Date: Fri, 11 May 2018 17:06:18 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>
In-Reply-To: <>

According to the doc, 'media_entity_cleanup()' must be called after
unregistering the entity.
All places I've check do it that way.
So, move the call after 'v4l2_device_unregister_subdev()' as done

Actually, this is not an issue, because 'media_entity_cleanup()' does
nothing, but it is more future proof.

Signed-off-by: Christophe JAILLET <>
The change from '&flash->sd.entity' to '&sd->entity' in the last hunk is
done because most of the drivers I've checked do it that way. Not sure if
it is correct. It looks logical to me and it can be compiled. That's all
I know.

If this patch is reviewed and confirmed, I'll propose similar fixes for
some other drivers.
 drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
index 1e5f516f6e50..b369b101abe7 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
@@ -902,11 +902,12 @@ static int lm3554_probe(struct i2c_client *client)
 		goto fail2;
 	return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
-	media_entity_cleanup(&flash->sd.entity);
+	media_entity_cleanup(&flash->sd.entity);
 	return err;
@@ -918,9 +919,9 @@ static int lm3554_remove(struct i2c_client *client)
 	struct lm3554 *flash = to_lm3554(sd);
 	int ret;
-	media_entity_cleanup(&flash->sd.entity);
+	media_entity_cleanup(&sd->entity);

devel mailing list

      parent reply	other threads:[~2018-05-11 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 15:06 [PATCH 0/3] media: staging: atomisp: Christophe JAILLET
2018-05-11 15:06 ` [PATCH 1/3] media: staging: atomisp: Return an error code in case of error in 'lm3554_probe()' Christophe JAILLET
2018-05-11 15:06 ` [PATCH 2/3] media: staging: atomisp: Fix an error handling path " Christophe JAILLET
2018-05-11 15:09   ` Julia Lawall
2018-05-11 15:31     ` Alan Cox
2018-05-11 15:06 ` Christophe JAILLET [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 3/3] media: staging: atomisp: Fix usage of '\''media_entity_cleanup()'\''' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).