From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH -next v4 2/3] media: ov772x: use SCCB regmap Date: Thu, 19 Jul 2018 15:14:06 +0300 Message-ID: <2173334.CLADOdgFxd@avalon> References: <1531756070-8560-1-git-send-email-akinobu.mita@gmail.com> <20180719074736.GA6784@w540> <20180719084208.4zdwt4vzcop4hve7@ninjato> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20180719084208.4zdwt4vzcop4hve7@ninjato> Sender: linux-kernel-owner@vger.kernel.org To: Wolfram Sang Cc: jacopo mondi , Akinobu Mita , linux-media@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown , Peter Rosin , Sebastian Reichel , Sylwester Nawrocki , Jacopo Mondi , Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab List-Id: linux-i2c@vger.kernel.org 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. -- Regards, Laurent Pinchart