Re: [PATCH] media: staging/imx: do not return error in link_notify for unknown sources

From: Steve Longerbeam
Date: Wed Oct 11 2017 - 19:14:47 EST




On 10/11/2017 04:06 PM, Russell King - ARM Linux wrote:
On Wed, Oct 11, 2017 at 03:14:26PM -0700, Steve Longerbeam wrote:

On 10/11/2017 02:49 PM, Russell King - ARM Linux wrote:
On Tue, Oct 03, 2017 at 12:09:13PM -0700, Steve Longerbeam wrote:
imx_media_link_notify() should not return error if the source subdevice
is not recognized by imx-media, that isn't an error. If the subdev has
controls they will be inherited starting from a known subdev.
What does "a known subdev" mean?
It refers to the previous sentence, "not recognized by imx-media". A
subdev that was not registered via async registration and so not in
imx-media's async subdev list. I could elaborate in the commit message
but it seems fairly obvious to me.
I don't think it's obvious, and I suspect you won't think it's obvious
in years to come (I talk from experience of some commentry I've added
in the past.)

Now, isn't it true that for a subdev to be part of a media device, it
has to be registered, and if it's part of a media device that is made
up of lots of different drivers, it has to use the async registration
code? So, is it not also true that any subdev that is part of a
media device, it will be "known"?

Under what circumstances could a subdev be part of a media device but
not be "known" ?

Now, if you mean "known" to be equivalent with "recognised by
imx-media" then, as I've pointed out several times already, that
statement is FALSE. I'm not sure how many times I'm going to have to
state this fact. Let me re-iterate again. On my imx219 driver, I
have two subdevs. Both subdevs have controls attached. The pixel
subdev is not "recognised" by imx-media, and without a modification
like my or your patch, it fails. However, with the modification,
this "unrecognised" subdev _STILL_ has it's controls visible through
imx-media.

Well that's true, the controls for your pixel subdev (which was
not registered via async) still are visible to imx-media, so in that
sense the subdev is "known" to imx-media.


Hence, I believe your comment in the code and your commit message
are misleading and wrong.

Ok you convinced me, I'll fix the code comment and commit
message.

Steve