From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755749AbdESIVG (ORCPT ); Fri, 19 May 2017 04:21:06 -0400 Received: from mga05.intel.com ([192.55.52.43]:60759 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755716AbdESIVB (ORCPT ); Fri, 19 May 2017 04:21:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,363,1491289200"; d="scan'208";a="1150167094" Date: Fri, 19 May 2017 11:20:50 +0300 From: Mika Westerberg To: Andy Shevchenko Cc: Greg Kroah-Hartman , Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , Amir Levy , Andy Lutomirski , Mario Limonciello , Jared.Dominguez@dell.com, Andy Shevchenko , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 07/24] thunderbolt: Convert switch to a device Message-ID: <20170519082050.GE3267@lahna.fi.intel.com> References: <20170518143914.60902-1-mika.westerberg@linux.intel.com> <20170518143914.60902-8-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 18, 2017 at 07:49:21PM +0300, Andy Shevchenko wrote: > On Thu, May 18, 2017 at 5:38 PM, Mika Westerberg > wrote: > > Thunderbolt domain consists of switches that are connected to each > > other, forming a bus. This will convert each switch into a real Linux > > device structure and adds them to the domain. The advantage here is > > that we get all the goodies from the driver core, like reference > > counting and sysfs hierarchy for free. > > > > Also expose device identification information to the userspace via new > > sysfs attributes. > > > > In order to support internal connection manager (ICM) we separate switch > > configuration into its own function (tb_switch_configure()) which is > > only called by the existing native connection manager implementation > > used on Macs. > > > > Couple of nits below. > > > + > > + return sw; > > +err: > > Perhaps > err_free_sw_ports: > ? Works for me :) > > + kfree(sw->ports); > > + kfree(sw); > > + return NULL; > > +} > > > + /* upload configuration */ > > + ret = tb_sw_write(sw, 1 + (u32 *) &sw->config, TB_CFG_SWITCH, 1, 3); > > Extra space before &. This comes from the original code but I'll change it. > > + if (ret) > > + return ret; > > -- > With Best Regards, > Andy Shevchenko