mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ramneek Mehresh <ramneek.mehresh@freescale.com>,
	<linux-kernel@vger.kernel.org>, <balbi@ti.com>,
	<gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	Li Yang <leoli@freescale.com>
Subject: Re: [PATCH 3/8][v2]usb:fsl:otg: Add support to add/remove usb host driver
Date: Mon, 10 Aug 2015 09:36:23 -0500	[thread overview]
Message-ID: <20150810143623.GD31059@saruman.tx.rr.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1508071616020.1794-100000@iolanthe.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

On Fri, Aug 07, 2015 at 04:33:33PM -0400, Alan Stern wrote:
> On Wed, 15 Jul 2015, Ramneek Mehresh wrote:
> 
> > Add workqueue to add/remove host driver (outside
> > interrupt context) upon each id change.
> > 
> > Signed-off-by: Li Yang <leoli@freescale.com>
> > Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
> > ---
> >  drivers/usb/host/ehci-fsl.c | 83 ++++++++++++++++++++++++++++++++++-----------
> >  drivers/usb/host/ehci-fsl.h | 20 +++++++++++
> >  2 files changed, 84 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
> > index 5352e74..81e4bf5 100644
> > --- a/drivers/usb/host/ehci-fsl.c
> > +++ b/drivers/usb/host/ehci-fsl.c
> > @@ -44,6 +44,34 @@
> >  
> >  static struct hc_driver __read_mostly fsl_ehci_hc_driver;
> >  
> > +#if defined(CONFIG_FSL_USB2_OTG) || defined(CONFIG_FSL_USB2_OTG_MODULE)
> 
> You've got these #if lines all over the place.  They look ugly and make
> the code hard to read.  Consider removing them.  Or even if you can't
> remove them entirely, removing most of them would help.
> 
> Also, instead of testing both CONFIG_FSL_USB2_OTG and
> CONFIG_FSL_USB2_OTG_MODULE, how about testing a single symbol?  For 
> example:
> 
> #if defined(CONFIG_FSL_USB2_OTG) || defined(CONFIG_FSL_USB2_OTG_MODULE)
> #define CHANGE_HCD 1
> #else
> #define CHANGE_HCD 0
> #endif
> 
> Then all you need later on is "#if CHANGE_HCD".  Or if it's inside a 
> code block, just "if (CHANGE_HCD)".

what about IS_ENABLED() ?

if (IS_ENABLED(CONFIG_FSL_USB2_OTG)) {
	foo();
} else {
	bar();
}

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-08-10 14:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 12:02 [PATCH 0/8][v2]Add OTG support for FSL socs Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 1/8][v2]usb:fsl:otg: Make fsl otg driver as tristate Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 2/8][v2]usb:fsl:otg: Add controller version based ULPI and UTMI phy Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 3/8][v2]usb:fsl:otg: Add support to add/remove usb host driver Ramneek Mehresh
2015-08-07 20:33   ` Alan Stern
2015-08-10  9:23     ` Ramneek Mehresh
2015-08-10 14:44       ` Alan Stern
2015-08-10 15:35         ` Ramneek Mehresh
2015-08-10 15:42           ` Fabio Estevam
2015-08-10 14:36     ` Felipe Balbi [this message]
2015-07-15 12:02 ` [PATCH 4/8][v2]usb:fsl:otg: Signal host drv when host is otg Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 5/8][v2]usb:fsl:otg: Modify otg_event to start host drv Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 6/8][v2]usb:fsl:otg: Combine host/gadget start/resume for ID change Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 7/8][v2]usb:fsl:otg: Remove host drv upon otg bring-up Ramneek Mehresh
2015-07-15 12:02 ` [PATCH 8/8][v2]usb:fsl:otg: Add host-gadget drv sync delay Ramneek Mehresh
2015-08-13 18:24 [PATCH 0/8][v3] Add OTG support for FSL socs Ramneek Mehresh
2015-08-13 18:25 ` [PATCH 3/8][v2]usb:fsl:otg: Add support to add/remove usb host driver Ramneek Mehresh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150810143623.GD31059@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ramneek.mehresh@freescale.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome