Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbdI2SpX convert rfc822-to-8bit (ORCPT ); Fri, 29 Sep 2017 14:45:23 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:56484 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752334AbdI2SpW (ORCPT ); Fri, 29 Sep 2017 14:45:22 -0400 X-IronPort-AV: E=Sophos;i="5.42,453,1500966000"; d="scan'208";a="7873389" From: To: CC: , , , , , , , Subject: RE: [PATCH RFC 3/5] Add KSZ8795 switch driver Thread-Topic: [PATCH RFC 3/5] Add KSZ8795 switch driver Thread-Index: AdMoGw7chwKpH5nHQDyZLhGSoYClOwAA0svAACf0VAAAAsLgkAAXu/yAAAb8AcAD2R/bgAAqcfQg Date: Fri, 29 Sep 2017 18:45:19 +0000 Message-ID: <93AF473E2DA327428DE3D46B72B1E9FD4112CBC8@CHN-SV-EXMX02.mchp-main.com> References: <93AF473E2DA327428DE3D46B72B1E9FD41121A87@CHN-SV-EXMX02.mchp-main.com> <20170908091856.GB17738@amd> <93AF473E2DA327428DE3D46B72B1E9FD41121E3D@CHN-SV-EXMX02.mchp-main.com> <20170908215735.GF27428@amd> <93AF473E2DA327428DE3D46B72B1E9FD41123010@CHN-SV-EXMX02.mchp-main.com> <20170928152445.GC2482@amd> In-Reply-To: <20170928152445.GC2482@amd> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.76.4] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 782 Lines: 19 > > > > > Similar code will be needed by other drivers, right? > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > chips will have different code. > > > > > > Ok, please make sure code is shared between these two. > > > > The exact function probably cannot be shared between KSZ8795 > > and KSZ8895 drivers because although the register constants look > > the same but their exact locations are different in the 2 chips. > > Put the code into header as static inline and include it from both > places? > Although KSZ8795 and KSZ8895 share the same code when simulating the PHY register access, even though the exact registers are not the same, this code needs a little modification for another chip. It also looks too large to put in a header.