diff options
Diffstat (limited to 'drivers/media/i2c')
| -rw-r--r-- | drivers/media/i2c/imx219.c | 13 | ||||
| -rw-r--r-- | drivers/media/i2c/max9286.c | 1 | ||||
| -rw-r--r-- | drivers/media/i2c/ov8858.c | 10 | ||||
| -rw-r--r-- | drivers/media/i2c/rdacm21.c | 1 | 
4 files changed, 9 insertions, 16 deletions
| diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index a1136fdfbed2..ec53abe2e84e 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -691,12 +691,12 @@ static int imx219_init_cfg(struct v4l2_subdev *sd,  	struct v4l2_mbus_framefmt *format;  	struct v4l2_rect *crop; -	/* Initialize try_fmt */ +	/* Initialize the format. */  	format = v4l2_subdev_get_pad_format(sd, state, 0);  	imx219_update_pad_format(imx219, &supported_modes[0], format,  				 MEDIA_BUS_FMT_SRGGB10_1X10); -	/* Initialize crop rectangle. */ +	/* Initialize the crop rectangle. */  	crop = v4l2_subdev_get_pad_crop(sd, state, 0);  	crop->top = IMX219_PIXEL_ARRAY_TOP;  	crop->left = IMX219_PIXEL_ARRAY_LEFT; @@ -750,6 +750,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,  	const struct imx219_mode *mode;  	int exposure_max, exposure_def, hblank;  	struct v4l2_mbus_framefmt *format; +	struct v4l2_rect *crop;  	mode = v4l2_find_nearest_size(supported_modes,  				      ARRAY_SIZE(supported_modes), @@ -757,10 +758,12 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,  				      fmt->format.width, fmt->format.height);  	imx219_update_pad_format(imx219, mode, &fmt->format, fmt->format.code); +  	format = v4l2_subdev_get_pad_format(sd, sd_state, 0); +	crop = v4l2_subdev_get_pad_crop(sd, sd_state, 0); -	if (imx219->mode == mode && format->code == fmt->format.code) -		return 0; +	*format = fmt->format; +	*crop = mode->crop;  	if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {  		imx219->mode = mode; @@ -788,8 +791,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,  					 hblank);  	} -	*format = fmt->format; -  	return 0;  } diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 20e7c7cf5eeb..be84ff1e2b17 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -1110,7 +1110,6 @@ err_async:  static void max9286_v4l2_unregister(struct max9286_priv *priv)  { -	fwnode_handle_put(priv->sd.fwnode);  	v4l2_ctrl_handler_free(&priv->ctrls);  	v4l2_async_unregister_subdev(&priv->sd);  	max9286_v4l2_notifier_unregister(priv); diff --git a/drivers/media/i2c/ov8858.c b/drivers/media/i2c/ov8858.c index 3af6125a2eee..4d9fd76e2f60 100644 --- a/drivers/media/i2c/ov8858.c +++ b/drivers/media/i2c/ov8858.c @@ -1850,9 +1850,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858)  	}  	ret = v4l2_fwnode_endpoint_parse(endpoint, &vep); +	fwnode_handle_put(endpoint);  	if (ret) {  		dev_err(dev, "Failed to parse endpoint: %d\n", ret); -		fwnode_handle_put(endpoint);  		return ret;  	} @@ -1864,12 +1864,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858)  	default:  		dev_err(dev, "Unsupported number of data lanes %u\n",  			ov8858->num_lanes); -		fwnode_handle_put(endpoint);  		return -EINVAL;  	} -	ov8858->subdev.fwnode = endpoint; -  	return 0;  } @@ -1913,7 +1910,7 @@ static int ov8858_probe(struct i2c_client *client)  	ret = ov8858_init_ctrls(ov8858);  	if (ret) -		goto err_put_fwnode; +		return ret;  	sd = &ov8858->subdev;  	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; @@ -1964,8 +1961,6 @@ err_clean_entity:  	media_entity_cleanup(&sd->entity);  err_free_handler:  	v4l2_ctrl_handler_free(&ov8858->ctrl_handler); -err_put_fwnode: -	fwnode_handle_put(ov8858->subdev.fwnode);  	return ret;  } @@ -1978,7 +1973,6 @@ static void ov8858_remove(struct i2c_client *client)  	v4l2_async_unregister_subdev(sd);  	media_entity_cleanup(&sd->entity);  	v4l2_ctrl_handler_free(&ov8858->ctrl_handler); -	fwnode_handle_put(ov8858->subdev.fwnode);  	pm_runtime_disable(&client->dev);  	if (!pm_runtime_status_suspended(&client->dev)) diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c index a36a709243fd..3e22df36354f 100644 --- a/drivers/media/i2c/rdacm21.c +++ b/drivers/media/i2c/rdacm21.c @@ -608,7 +608,6 @@ static void rdacm21_remove(struct i2c_client *client)  	v4l2_async_unregister_subdev(&dev->sd);  	v4l2_ctrl_handler_free(&dev->ctrls);  	i2c_unregister_device(dev->isp); -	fwnode_handle_put(dev->sd.fwnode);  }  static const struct of_device_id rdacm21_of_ids[] = { | 
