Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbdHWMmP (ORCPT ); Wed, 23 Aug 2017 08:42:15 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:40900 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753834AbdHWMmO (ORCPT ); Wed, 23 Aug 2017 08:42:14 -0400 Date: Wed, 23 Aug 2017 14:42:07 +0200 From: Andrew Lunn To: Pavel Machek Cc: Woojung.Huh@microchip.com, nathan.leigh.conrad@gmail.com, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Tristram.Ha@micrel.com Subject: Re: DSA support for Micrel KSZ8895 Message-ID: <20170823124207.GB28612@lunn.ch> References: <20170816075524.GA18532@amd> <20170816140451.GA13006@lunn.ch> <9235D6609DB808459E95D78E17F2E43D40AFF8C1@CHN-SV-EXMX02.mchp-main.com> <20170823090941.GA27570@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170823090941.GA27570@amd> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 422 Lines: 10 > Any ideas how to do the work in a way to minimize code duplication are > welcome... A lot depends on how much duplication there is. mv88e6xxx uses a set of function points per chip variant. Another option is to put the common code into a library, and have two drivers. Or if it is the same registers, but at different locations, you can add a translation function, which is what i think the b53 driver does. Andrew