Message ID | 20190412234359.5079-8-niklas.soderlund+renesas@ragnatech.se (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | rcar-vin: Merge Gen2 and Gen3 file operations | expand |
On 13.04.2019 2:43, Niklas Söderlund wrote: > The function no longer serve a purpose as most tasks it performed have > been refactored, fold what remains it into the only caller. What remains of it? > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> [...] MBR, Sergei
> On April 13, 2019 at 1:43 AM Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> wrote: > > > The function no longer serve a purpose as most tasks it performed have > been refactored, fold what remains it into the only caller. > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> > --- > drivers/media/platform/rcar-vin/rcar-v4l2.c | 21 ++++----------------- > 1 file changed, 4 insertions(+), 17 deletions(-) > > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c > index 3b4624c117aaba18..58d0b59ee1247c8f 100644 > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c > @@ -762,20 +762,6 @@ static int rvin_power_parallel(struct rvin_dev *vin, int on) > return 0; > } > > -static int rvin_initialize_device(struct file *file) > -{ > - struct rvin_dev *vin = video_drvdata(file); > - int ret; > - > - ret = rvin_power_parallel(vin, 1); > - if (ret < 0) > - return ret; > - > - v4l2_ctrl_handler_setup(&vin->ctrl_handler); > - > - return 0; > -} > - > static int rvin_open(struct file *file) > { > struct rvin_dev *vin = video_drvdata(file); > @@ -796,10 +782,11 @@ static int rvin_open(struct file *file) > goto err_pm; > > if (v4l2_fh_is_singular_file(file)) { > - if (rvin_initialize_device(file)) { > - ret = -ENODEV; > + ret = rvin_power_parallel(vin, 1); "1" -> "true". (See patch 6/8.) > + if (ret < 0) > goto err_open; > - } > + > + v4l2_ctrl_handler_setup(&vin->ctrl_handler); > } > > mutex_unlock(&vin->lock); > -- > 2.21.0 > With the above fixed, Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu> CU Uli
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 3b4624c117aaba18..58d0b59ee1247c8f 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -762,20 +762,6 @@ static int rvin_power_parallel(struct rvin_dev *vin, int on) return 0; } -static int rvin_initialize_device(struct file *file) -{ - struct rvin_dev *vin = video_drvdata(file); - int ret; - - ret = rvin_power_parallel(vin, 1); - if (ret < 0) - return ret; - - v4l2_ctrl_handler_setup(&vin->ctrl_handler); - - return 0; -} - static int rvin_open(struct file *file) { struct rvin_dev *vin = video_drvdata(file); @@ -796,10 +782,11 @@ static int rvin_open(struct file *file) goto err_pm; if (v4l2_fh_is_singular_file(file)) { - if (rvin_initialize_device(file)) { - ret = -ENODEV; + ret = rvin_power_parallel(vin, 1); + if (ret < 0) goto err_open; - } + + v4l2_ctrl_handler_setup(&vin->ctrl_handler); } mutex_unlock(&vin->lock);
The function no longer serve a purpose as most tasks it performed have been refactored, fold what remains it into the only caller. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)