A few more more mundane comments... On Tue, Apr 20, 2021 at 06:35:10PM +0300, Sakari Ailus wrote: ... > > +int v4l2_subdev_init_config(struct v4l2_subdev *sd, struct v4l2_subdev_config *cfg) > > { > > - struct v4l2_subdev_pad_config *cfg; > > int ret; > > > > - if (!sd->entity.num_pads) > > - return NULL; > > - > > - cfg = kvmalloc_array(sd->entity.num_pads, sizeof(*cfg), > > - GFP_KERNEL | __GFP_ZERO); > > - if (!cfg) > > - return NULL; > > + if (sd->entity.num_pads) { > > + cfg->pad_configs = kvmalloc_array(sd->entity.num_pads, sizeof(*cfg->pad_configs), > > + GFP_KERNEL | __GFP_ZERO); Please also pay attention to line length and aligning arguments. ... > > @@ -1093,20 +1097,17 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, > > int v4l2_subdev_link_validate(struct media_link *link); > > > > /** > > - * v4l2_subdev_alloc_pad_config - Allocates memory for pad config > > + * v4l2_subdev_init_config - initialize v4l2_subdev_config > > * > > - * @sd: pointer to struct v4l2_subdev > > + * Must call v4l2_subdev_uninit_config() when config is no longer needed. > > */ > > -struct > > -v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd); > > +int v4l2_subdev_init_config(struct v4l2_subdev *sd, struct v4l2_subdev_config *cfg); This should be wrapped, too... there are some others as well in this patch I think. -- Sakari Ailus