Re: [PATCH 1/2] V4L: mt9m111: propagate higher level abstraction down in functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/06/2011 07:20 PM, Guennadi Liakhovetski wrote:
It is more convenient to propagate the higher level abstraction - the
struct mt9m111 object into functions and then retrieve a pointer to
the i2c client, if needed, than to do the reverse.
Agreed.

One minor point, you ofter replace :
> -	struct mt9m111 *mt9m111 = to_mt9m111(client);
> +	struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);

Why haven't you replaced the signature of to_mt9m111() into :
static struct mt9m111 *to_mt9m111(const struct v4l2_subdev *sd)
{
	return container_of(sd, struct mt9m111, subdev);
}

This way, each to_mt9m111(client) will become to_mt9m111(sd), and the purpose of to_mt9m111() will be kept. Wouldn't that be better ?

Else I agree with everything else.

Cheers.

--
Robert
--
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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux