All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: Roger Quadros <rogerq@ti.com>,
	bcousson@baylibre.com, tony@atomide.com, balbi@ti.com,
	sre@debian.org, mark.rutland@arm.com,
	m.paolino@virtualopensystems.com, linux-omap@vger.kernel.org,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH v5 2/9] mfd: omap-usb-host: Get clocks based on hardware revision
Date: Fri, 10 Jan 2014 15:13:39 +0100	[thread overview]
Message-ID: <201401101513.40470.arnd@arndb.de> (raw)
In-Reply-To: <20140110102251.GH28141@lee--X1>

On Friday 10 January 2014, Lee Jones wrote:
> >  
> > -     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?

I think ENODEV is ok here, I'd much prefer this over IS_ERR_OR_NULL().

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
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 15:13:39 +0100	[thread overview]
Message-ID: <201401101513.40470.arnd@arndb.de> (raw)
In-Reply-To: <20140110102251.GH28141@lee--X1>

On Friday 10 January 2014, Lee Jones wrote:
> >  
> > -     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?

I think ENODEV is ok here, I'd much prefer this over IS_ERR_OR_NULL().

	Arnd

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

Thread overview: 47+ 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 ` Roger Quadros
2014-01-09 12:08 ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 1/9] mfd: omap-usb-host: Use resource managed clk_get() Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-10 10:12   ` Lee Jones
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-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-10 10:22   ` Lee Jones
2014-01-10 10:22     ` Lee Jones
2014-01-10 14:13     ` Arnd Bergmann [this message]
2014-01-10 14:13       ` Arnd Bergmann
2014-01-10 14:26       ` Lee Jones
2014-01-10 14:26         ` Lee Jones
2014-01-20  9:14         ` Roger Quadros
2014-01-20  9:14           ` Roger Quadros
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-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-10 10:11   ` Lee Jones
2014-01-10 10:11     ` Lee Jones
2014-01-10 10:11     ` Lee Jones
2014-01-20  9:14     ` Roger Quadros
2014-01-20  9:14       ` Roger Quadros
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   ` Roger Quadros
2014-01-09 12:08   ` 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   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 6/9] ARM: dts: omap5: " Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` 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   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 8/9] ARM: dts: omap5-uevm: " Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08 ` [PATCH v5 9/9] ARM: OMAP2+: Remove legacy_init_ehci_clk() Roger Quadros
2014-01-09 12:08   ` Roger Quadros
2014-01-09 12:08   ` 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=201401101513.40470.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=balbi@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.paolino@virtualopensystems.com \
    --cc=mark.rutland@arm.com \
    --cc=rogerq@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=sre@debian.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.