Re: [PATCH/RFC] core: add a function to safely try to get device driver owner

Jonathan Corbet
2010-11-29T22:28:41Z

On Mon, 29 Nov 2010 23:10:50 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:

> In my case I have two platform devices: CEU and CSI2. In some cases (with
> parallel sensors) CEU operates on its own. With serial (CSI-2) camera
> sensors we need the CSI2 driver. So, I want to
> try_module_get(csi2_dev->driver->owner) the CSI2 driver from my CEU
> driver. This call can Oops if not done safely. Am I missing something? Is
> there an easier way to achieve the same?

This looks exactly like what the V4L2 subdev mechanism was meant to do.
Is there a reason you can't use that interface?

Thanks,

jon