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

From: Jonathan Corbet
Date: Mon Nov 29 2010 - 17:28:44 EST


On Mon, 29 Nov 2010 23:10:50 +0100 (CET)
Guennadi Liakhovetski <g.liakhovetski@xxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/