linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/9] mfd: omap-usb-host: Get clocks based on hardware revision
Date: Fri, 10 Jan 2014 10:22:51 +0000	[thread overview]
Message-ID: <20140110102251.GH28141@lee--X1> (raw)
In-Reply-To: <1389269303-30465-3-git-send-email-rogerq@ti.com>

> Not all revisions have all the clocks so get the necessary clocks
> based on hardware revision.
> 
> This should avoid un-necessary clk_get failure messages that were
> observed earlier.
> 
> Be more strict and always fail on clk_get() error.
> 
> CC: Lee Jones <lee.jones@linaro.org>
> CC: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/mfd/omap-usb-host.c | 93 +++++++++++++++++++++++++++++++--------------
>  1 file changed, 64 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 1c9bca2..7202cc6 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -92,7 +92,6 @@
>  #define is_ehci_tll_mode(x)	(x == OMAP_EHCI_PORT_MODE_TLL)
>  #define is_ehci_hsic_mode(x)	(x == OMAP_EHCI_PORT_MODE_HSIC)
>  
> -

Sneaky! ;)

>  struct usbhs_hcd_omap {
>  	int				nports;
>  	struct clk			**utmi_clk;
> @@ -665,22 +664,41 @@ static int usbhs_omap_probe(struct platform_device *pdev)
>  		goto err_mem;
>  	}
>  
> -	need_logic_fck = false;
> +	/* Set all clocks as invalid to begin with */
> +	omap->ehci_logic_fck = omap->init_60m_fclk = ERR_PTR(-EINVAL);
> +	omap->utmi_p1_gfclk = omap->utmi_p2_gfclk = ERR_PTR(-EINVAL);
> +	omap->xclk60mhsp1_ck = omap->xclk60mhsp2_ck = ERR_PTR(-EINVAL);

I don't think this is the correct error code.

-EINVAL means 'invalid parameter'.

You probably want -ENODEV or -ENOSYS ('function not implemented'
probably isn't ideal either tbh, but you get the idea). Perhaps you
can set them as NULL and check for IS_ERR_OR_NULL() instead?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2014-01-10 10:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 12:08 [PATCH v5 0/9] USB Host support for OMAP5 uEVM (for 3.14) Roger Quadros
2014-01-09 12:08 ` [PATCH v5 1/9] mfd: omap-usb-host: Use resource managed clk_get() Roger Quadros
2014-01-10 10:12   ` Lee Jones
2014-01-09 12:08 ` [PATCH v5 2/9] mfd: omap-usb-host: Get clocks based on hardware revision Roger Quadros
2014-01-10 10:22   ` Lee Jones [this message]
2014-01-10 14:13     ` Arnd Bergmann
2014-01-10 14:26       ` Lee Jones
2014-01-20  9:14         ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 3/9] mfd: omap-usb-host: Update DT clock binding information Roger Quadros
2014-01-10 10:11   ` Lee Jones
2014-01-20  9:14     ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 4/9] mfd: omap-usb-tll: " Roger Quadros
2014-01-09 12:08 ` [PATCH v5 5/9] ARM: dts: omap4: Update omap-usb-host node Roger Quadros
2014-01-09 12:08 ` [PATCH v5 6/9] ARM: dts: omap5: " Roger Quadros
2014-01-09 12:08 ` [PATCH v5 7/9] ARM: dts: omap4-panda: Provide USB PHY clock Roger Quadros
2014-01-09 12:08 ` [PATCH v5 8/9] ARM: dts: omap5-uevm: " Roger Quadros
2014-01-09 12:08 ` [PATCH v5 9/9] ARM: OMAP2+: Remove legacy_init_ehci_clk() Roger Quadros

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=20140110102251.GH28141@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).