media: i2c: imx258: simplify getting state container
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 27 Jan 2021 17:46:34 +0000 (18:46 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 6 Feb 2021 08:36:29 +0000 (09:36 +0100)
commit2b585242b8619799fab2d0840f35cc936ed88749
treec29284e65d8aeb113798a5ed361f26e07b2d77bc
parent9d14932d3eb0644684aa85b4f2dd5a90c455b2be
media: i2c: imx258: simplify getting state container

The pointer to 'struct v4l2_subdev' is stored in drvdata via
v4l2_i2c_subdev_init() so there is no point of a dance like:

struct i2c_client *client = to_i2c_client(struct device *dev)
struct v4l2_subdev *sd = i2c_get_clientdata(client);

This allows to remove local variable 'client' and few pointer
dereferences.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/imx258.c