Hi Laurent,
Laurent Pinchart wrote:
Hi Sakari,
Thank you for the patch.
On Tuesday 17 December 2013 15:49:24 Sakari Ailus wrote:
When the sub-device is registered, increment the use count of the sub-device
owner only if it's different from the owner of the driver for the media
device. This avoids increasing the use count by the module itself and thus
making it possible to unload it when it's not in use.
Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
This looks good to me, but I wonder whether a more generic solution won't be
needed, to solve the multiple circular reference issues we (will) have with
subdevices and clocks. My gut feeling is that such a generic solution will
also cater for the needs of the problem you're trying to solve here.
I can't immediately think of solving this in a generic fashion. There
are dependencies to API behaviour for instance. For clocks this could be
resolved by changing how clk_get() is used by sensor drivers, or
changing the clock framework to allow unregistering clocks even if they
have been obtained by the users but not enabled. Considering the current
implementation of clk_unregister(), the need for (some) changes is
apparent. (I could miss some changes elsewhere as I just checked
linux-media.)
The above would still resolve this for clocks alone.
This being said, there's no reason to delay this patch until a more generic
solution is available, so
Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Thanks!
--
Kind regards,
Sakari Ailus
sakari.ailus@xxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html