Hi Mauro, On Mon, 2 Mar 2015, Mauro Carvalho Chehab wrote: > Em Sun, 1 Feb 2015 12:12:33 +0100 (CET) > Guennadi Liakhovetski <g.liakhovetski@xxxxxx> escreveu: > > > V4L2 clocks, e.g. used by camera sensors for their master clock, do not > > have to be supplied by a different V4L2 driver, they can also be > > supplied by an independent source. In this case the standart kernel > > clock API should be used to handle such clocks. This patch adds support > > for such cases. > > > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx> > > Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > > --- > > > > v4: sizeof(*clk) :) > > > > drivers/media/v4l2-core/v4l2-clk.c | 48 +++++++++++++++++++++++++++++++++++--- > > include/media/v4l2-clk.h | 2 ++ > > 2 files changed, 47 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-clk.c b/drivers/media/v4l2-core/v4l2-clk.c > > index 3ff0b00..9f8cb20 100644 > > --- a/drivers/media/v4l2-core/v4l2-clk.c > > +++ b/drivers/media/v4l2-core/v4l2-clk.c > > @@ -9,6 +9,7 @@ > > */ > > > > #include <linux/atomic.h> > > +#include <linux/clk.h> > > #include <linux/device.h> > > #include <linux/errno.h> > > #include <linux/list.h> > > @@ -37,6 +38,21 @@ static struct v4l2_clk *v4l2_clk_find(const char *dev_id) > > struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) > > { > > struct v4l2_clk *clk; > > + struct clk *ccf_clk = clk_get(dev, id); > > + > > + if (PTR_ERR(ccf_clk) == -EPROBE_DEFER) > > + return ERR_PTR(-EPROBE_DEFER); > > Why not do just: > return ccf_clk; I would prefer that shorter form too, but the function returns "struct v4l2_clk *" and ccf_clk is "struct clk *" Thanks Guennadi -- 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