Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1680417imm; Thu, 19 Jul 2018 06:11:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcOXotwCf8kd/OyyZ2IKmloMPfAZeSC9a6IMikXEGWZHIyav1WHCl8IZeru5bWyCDoGAdbq X-Received: by 2002:a17:902:4424:: with SMTP id k33-v6mr10039594pld.242.1532005890630; Thu, 19 Jul 2018 06:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532005890; cv=none; d=google.com; s=arc-20160816; b=PRUsyOEtg0BgcCYZ9PvdFzvIObO4f3HGuktA+PcKAXZ5+jElWwEflWboRCW/3nmEKb cLQmjxZEimhi9r/brK9ZLuHd0RocITnD628qhMO955SGJqHYaJT3P5vU+RRKXUdfr/PN xoTW8o+w7INzXsR7mA7XeM2DM+f4mPlAIkF6gZFovDL/7Xnc94wZ553JTneXgVcBzPjl Qd6eHYULvtFKD7lfotsBsy/N5u1AWU82/XAIYr8BBUXW2wVqQFCw4yaTWanJCtgMv/R9 E8LunCbCZDR002wpG7daJa6GA0MIi3wJJtkxVk0jTem8KWkCMc8h+JVas07YMgitPj4T YXcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=jsDW+kvibIQrOm+NZ4mPn7sB8NZzIMnhgK7Ct2TldO8=; b=hzHrOVry5UQ+w/8Kz/XqkoL1CZnvskK+iYp749R8jJ9umzG+Zjbd+txPj1uZuouvPQ grzzITYyaACQMFp7ua5CUCbwp0b24P5klxdk9bc88f3hNK1CYXxr9L2fq2e7BBwu+SaU DQ5JEqE42Oh77HPmQH9Iqz+qkdQLWs4HUKIdWdaJsakjgDeqgIM9FJHwISI4w+6mA1zh bqCF7/Jl4OIC5Bj09v0cmKRItK+2XLUskNg5trYivkv+u+UmDMWnvHYXYXlMSyA/ypmJ D35JvFS+J6+wkdbu3lb66xoUdwzGF032XBzoxpjP37XS6gCpBEOXElDV1uVagUDMWiPW jvYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g80-v6si6049821pfk.53.2018.07.19.06.10.58; Thu, 19 Jul 2018 06:11:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731699AbeGSNx3 (ORCPT + 99 others); Thu, 19 Jul 2018 09:53:29 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:59180 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731126AbeGSNx3 (ORCPT ); Thu, 19 Jul 2018 09:53:29 -0400 Received: from lanttu.localdomain (unknown [IPv6:2001:1bc8:1a6:d3d5::e1:1001]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 916CA634C83; Thu, 19 Jul 2018 16:10:21 +0300 (EEST) Received: from sailus by lanttu.localdomain with local (Exim 4.89) (envelope-from ) id 1fg8hI-0006Or-T6; Thu, 19 Jul 2018 16:10:20 +0300 Date: Thu, 19 Jul 2018 16:10:20 +0300 From: sakari.ailus@iki.fi To: Laurent Pinchart Cc: Wolfram Sang , 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 Subject: Re: [PATCH -next v4 2/3] media: ov772x: use SCCB regmap Message-ID: <20180719131019.2kolodvc4r5ewqic@lanttu.localdomain> References: <1531756070-8560-1-git-send-email-akinobu.mita@gmail.com> <20180719074736.GA6784@w540> <20180719084208.4zdwt4vzcop4hve7@ninjato> <2173334.CLADOdgFxd@avalon> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2173334.CLADOdgFxd@avalon> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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