public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: George Cherian <george.cherian@ti.com>,
	balbi@ti.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH v3 2/4] usb: dwc3: dwc3-omap: Add dwc3_omap_map_offset() function
Date: Wed, 16 Jul 2014 17:19:45 +0400	[thread overview]
Message-ID: <53C67BF1.1070407@cogentembedded.com> (raw)
In-Reply-To: <1405516028-26500-3-git-send-email-george.cherian@ti.com>

Hello.

On 07/16/2014 05:07 PM, George Cherian wrote:

> Move map offset to its own seperate function.

    /seperate/separate/.

> Improve code readability, decrease the dwc3_probe() size.

> Signed-off-by: George Cherian <george.cherian@ti.com>
> ---
>   drivers/usb/dwc3/dwc3-omap.c | 33 ++++++++++++++++++++-------------
>   1 file changed, 20 insertions(+), 13 deletions(-)

> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 999bdc8..09918ac 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -378,6 +378,25 @@ static int dwc3_omap_vbus_notifier(struct notifier_block *nb,
>   	return NOTIFY_DONE;
>   }
>
> +static void dwc3_omap_map_offset(struct dwc3_omap *omap)
> +{
> +	struct device_node	*node = omap->dev->of_node;
> +
> +	/* Differentiate between OMAP5 and AM437x.
> +	 * For OMAP5(ES2.0) and AM437x wrapper revision is same  even

   I don't think removing comma before "even" was correct.

> +	 * though there are changes in wrapper register offsets.
> +	 * Using dt compatible to differentiate  AM437x.

    s/dt/DT/.

> +	 */
> +
> +	if (of_device_is_compatible(node, "ti,am437x-dwc3")) {
> +		omap->irq_eoi_offset = USBOTGSS_EOI_OFFSET;
> +		omap->irq0_offset = USBOTGSS_IRQ0_OFFSET;
> +		omap->irqmisc_offset = USBOTGSS_IRQMISC_OFFSET;
> +		omap->utmi_otg_offset = USBOTGSS_UTMI_OTG_OFFSET;
> +		omap->debug_offset = USBOTGSS_DEBUG_OFFSET;
> +	}
> +}
> +
>   static int dwc3_omap_probe(struct platform_device *pdev)
>   {
>   	struct device_node	*node = pdev->dev.of_node;
> @@ -442,19 +461,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
>   		goto err0;
>   	}
>
> -	/* Differentiate between OMAP5 and AM437x.
> -	 * For OMAP5(ES2.0) and AM437x wrapper revision is same, even
> -	 * though there are changes in wrapper register offsets.
> -	 * Using dt compatible to differentiate  AM437x.
> -	 */
> -
> -	if (of_device_is_compatible(node, "ti,am437x-dwc3")) {
> -		omap->irq_eoi_offset = USBOTGSS_EOI_OFFSET;
> -		omap->irq0_offset = USBOTGSS_IRQ0_OFFSET;
> -		omap->irqmisc_offset = USBOTGSS_IRQMISC_OFFSET;
> -		omap->utmi_otg_offset = USBOTGSS_UTMI_OTG_OFFSET;
> -		omap->debug_offset = USBOTGSS_DEBUG_OFFSET;
> -	}
> +	dwc3_omap_map_offset(omap);

WBR, Sergei


  reply	other threads:[~2014-07-16 13:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 13:07 [RESEND PATCH v3 0/4] Cleanup for dwc3-omap George Cherian
2014-07-16 13:07 ` [RESEND PATCH v3 1/4] usb: dwc3: dwc3-omap: Remove x_major calculation from revision register George Cherian
2014-07-16 13:07 ` [RESEND PATCH v3 2/4] usb: dwc3: dwc3-omap: Add dwc3_omap_map_offset() function George Cherian
2014-07-16 13:19   ` Sergei Shtylyov [this message]
2014-07-16 13:07 ` [RESEND PATCH v3 3/4] usb: dwc3: dwc3-omap: Add dwc3_omap_set_utmi_mode() function George Cherian
2014-07-16 13:07 ` [RESEND PATCH v3 4/4] usb: dwc3: dwc3-omap: Add dwc3_omap_extcon_register function George Cherian

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=53C67BF1.1070407@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=balbi@ti.com \
    --cc=george.cherian@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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