lkml.org 
[lkml]   [2018]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next v4 2/3] media: ov772x: use SCCB regmap
On Thu, Jul 19, 2018 at 03:14:06PM +0300, Laurent Pinchart wrote:
> On Thursday, 19 July 2018 11:42:08 EEST Wolfram Sang wrote:
> > > > -static int ov772x_mask_set(struct i2c_client *client, u8 command, u8
> > > > mask,
> > > > - u8 set)
> > > > -{
> > > > - s32 val = ov772x_read(client, command);
> > > > -
> > > > - if (val < 0)
> > > > - return val;
> > > > -
> > > > - val &= ~mask;
> > > > - val |= set & mask;
> > > > -
> > > > - return ov772x_write(client, command, val);
> > > > -}
> > > > -
> > >
> > > If I were you I would have kept these functions and wrapped the regmap
> > > operations there. This is not an issue though if you prefer it this
> > > way :)
> >
> > I have suggested this way. It is not a show stopper issue, but I still
> > like this version better.
>
> Wrapping the regmap functions minimizes the diff and makes it easier to
> backport the driver.

May be, but using the regmap functions directly makes the driver cleaner.
Most drivers have some kind of wrappers around the I²C framework (or
regmap) functions; this one is one of the few to get rid of them.

The two could be done in a separate patch, too, albeit I think the current
one seems fine as such.

--
Sakari Ailus
e-mail: sakari.ailus@iki.fi

\
 
 \ /
  Last update: 2018-07-19 15:13    [W:0.060 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site