}
};
-static struct fimc_is_sensor *sd_to_fimc_is_sensor(struct v4l2_subdev *sd)
-{
- return container_of(sd, struct fimc_is_sensor, subdev);
-}
-
static const struct v4l2_mbus_framefmt *find_sensor_format(
struct v4l2_mbus_framefmt *mf)
{
static int fimc_is_sensor_s_power(struct v4l2_subdev *sd, int on)
{
- struct fimc_is_sensor *sensor = v4l2_get_subdevdata(sd);
+ struct fimc_is_sensor *sensor = sd_to_fimc_is_sensor(sd);
int gpio = sensor->gpio_reset;
int ret;
if (ret < 0)
return ret;
- v4l2_set_subdevdata(sd, sensor);
pm_runtime_no_callbacks(dev);
pm_runtime_enable(dev);
struct v4l2_mbus_framefmt format;
};
+static inline
+struct fimc_is_sensor *sd_to_fimc_is_sensor(struct v4l2_subdev *sd)
+{
+ return container_of(sd, struct fimc_is_sensor, subdev);
+}
+
int fimc_is_register_sensor_driver(void);
void fimc_is_unregister_sensor_driver(void);
if (WARN_ON(is->sensor))
continue;
- is->sensor = v4l2_get_subdevdata(sd);
+ is->sensor = sd_to_fimc_is_sensor(sd);
if (fimc_is_parse_sensor_config(is->sensor, child)) {
dev_warn(&is->pdev->dev, "DT parse error: %s\n",