Received: by 10.213.65.68 with SMTP id h4csp1021507imn; Wed, 21 Mar 2018 00:02:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELudXuixVhvyjOdg0ETxuYdkPr99AedS2POPPlGdk/IAx/fWmIud+1f7CwZVEb7BL3NdZBj3 X-Received: by 10.98.246.16 with SMTP id x16mr15958598pfh.81.1521615764478; Wed, 21 Mar 2018 00:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521615764; cv=none; d=google.com; s=arc-20160816; b=mhvcpjCRU+fAY1WY/3n21d1t9JVeXTGAfE6fiGx/GBJEElMhtkgDxYn3tpoN4IFRzM QWojyOO4ZLyfDCV8pAYGjLAJaaL791VEejgw4j0bmSbUe1Q7OVLqQ6bEOD7prYE4vz/V uONObSGTgsPjUQSP+SU+cm4wTjKR8WY+2xQ9deKlw1lgqCwbiV3SsKheQ+Ab0vXd1V7s MDdKsPZUlgKkr33YEHTy5NojgThf6A8VcVIwX1dXGO9ovUV2Jj460J+/Ntirx/O4309p qg0fAHskqhCBe1v8xIn+mTwPqUBowQXd2P0RKkIQDspf2/yRall5KaG678ZTXWq3hBvq wNTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=uocmo2A+TkzmiYYzJlaDFngAyukw7YfTP183fuxtu7E=; b=HOsEFSPsZ1dTP8wPmmX2SpHQphohpVl6Rea53JKMjxdmZCqH7TBj3AyPGJmwdEBP36 58SlXAofRZ38lQtljZUB66nY0EaD7H/MFMr9di4vuWSGLtoRu+VspZ8pfUcIIcN712pv 2IVHjaVYOQa03rFVPSXe6SMZLeOFD/G66nBJInMVoJfnSjbSO7Fubr4VDt3YXaEBr6Yx P2T3c6s5t+6AQuHPGcs99BOd2+bVB/o08WpZnc+EsBHwoeBE//EgWuSIgn9nhSSHFOx6 0BnRnPDRvrHq03/LGGKi/XDJXhoAShRCqStLgNdq7yAf18h60m3TC0muzCwbV8koCYHi t4ZA== 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 k11si2309655pgo.753.2018.03.21.00.02.29; Wed, 21 Mar 2018 00:02:44 -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 S1751526AbeCUHBh (ORCPT + 99 others); Wed, 21 Mar 2018 03:01:37 -0400 Received: from mleia.com ([178.79.152.223]:60720 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeCUHBf (ORCPT ); Wed, 21 Mar 2018 03:01:35 -0400 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 9C9473FA1C2; Wed, 21 Mar 2018 07:01:34 +0000 (GMT) Subject: Re: [PATCH 3/3] i2c: mux: pca9541: prepare for PCA9641 support To: Guenter Roeck , Peter Rosin , linux-kernel@vger.kernel.org, Ken Chen Cc: Wolfram Sang , joel@jms.id.au, linux-i2c@vger.kernel.org References: <20180320061909.5775-1-chen.kenyy@inventec.com> <20180320093200.19179-1-peda@axentia.se> <20180320093200.19179-4-peda@axentia.se> <3cfc6e53-a86d-8ef1-b83d-9f3c1b3d7b9c@roeck-us.net> From: Vladimir Zapolskiy Message-ID: <67f0b5fb-5df7-0354-bfd6-5969b6fc7bb1@mleia.com> Date: Wed, 21 Mar 2018 09:01:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <3cfc6e53-a86d-8ef1-b83d-9f3c1b3d7b9c@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20180321_070134_659556_A728466F X-CRM114-Status: GOOD ( 12.83 ) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/21/2018 03:19 AM, Guenter Roeck wrote: > On 03/20/2018 04:17 PM, Vladimir Zapolskiy wrote: >> Hi Peter, Ken, >> >> On 03/20/2018 11:32 AM, Peter Rosin wrote: >>> Make the arbitrate and release_bus implementation chip specific. >>> >> >> by chance I took a look at the original implementation done by Ken, and >> I would say that this 3/3 change is an overkill as a too generic one. >> Is there any next observable extension? And do two abstracted (*arbitrate) >> and (*release_bus) cover it well? Probably no. >> >> At first it would be simpler to add a new chip id field into struct pca9541 >> (struct rename would be needed of course), and do a selection of specific >> pca9x41_arbitrate() and pca9x41_release_bus() depending on it: >> > > FWIW, I very much prefer Peter's code. I think it is much cleaner. Peter's code is generic, and it makes the change about 3 times longer in lines of code, and the following pca9641 change on top of it will be larger as well, because generalization requires service. My main concern is that if such generalization is really needed in the driver. -- With best wishes, Vladimir