Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758916AbbLBSR0 (ORCPT ); Wed, 2 Dec 2015 13:17:26 -0500 Received: from mga03.intel.com ([134.134.136.65]:56607 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755921AbbLBSRZ (ORCPT ); Wed, 2 Dec 2015 13:17:25 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,374,1444719600"; d="scan'208";a="6332701" Date: Wed, 2 Dec 2015 10:17:22 -0800 From: David Cohen To: Heikki Krogerus Cc: Chanwoo Choi , Greg Kroah-Hartman , MyungJoo Ham , Lu Baolu , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] extcon: add driver for Intel USB mux Message-ID: <20151202181722.GA8743@psi-dev26.jf.intel.com> References: <1448976758-35807-1-git-send-email-heikki.krogerus@linux.intel.com> <1448976758-35807-2-git-send-email-heikki.krogerus@linux.intel.com> <20151201202834.GA5617@psi-dev26.jf.intel.com> <20151202102710.GC7587@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151202102710.GC7587@kuha.fi.intel.com> 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: 1376 Lines: 41 Hi Heikki, On Wed, Dec 02, 2015 at 12:27:10PM +0200, Heikki Krogerus wrote: > Hi David, > > > > > > +void intel_usb_mux_unregister(struct intel_usb_mux *mux) > > > +{ > > > > There are still 2 pending comments for this unregister function: > > > > 1) How about a protection against unbalanced unregistering? In case an > > user mistakenly unregisters twice or unregisters without a previous > > registering. > > True. You already pointed that out in our off-list thread, but I > forgot. Sorry about that. > > > 2) When unregistering, you need to clear the bit CFG0_SW_IDPIN_EN to > > set mux to automatic mode again. Or maybe you could save CFG0's initial > > value and set it again here. Anyway, when unregistering the mux driver > > you need to make sure the mux goes back to its original configuration. > > This one is already been taken care of.. > > > > + extcon_unregister_notifier(&mux->edev, EXTCON_USB_HOST, &mux->nb); > > > + extcon_dev_unregister(&mux->edev); > > > + writel(mux->cfg0_ctx, mux->regs + INTEL_MUX_CFG0); > > ^^^^^^^^^^^^^^^^^^^^ Of course :) Sorry I missed this part. Br, David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/