linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: [PATCH 2/3] pinctrl: sh-pfc: r8a7778: Add bias (pull-up) pinconf support
@ 2015-03-30 11:38 Ulrich Hecht
  0 siblings, 0 replies; only message in thread
From: Ulrich Hecht @ 2015-03-30 11:38 UTC (permalink / raw)
  To: linux-sh

On Mon, Mar 30, 2015 at 12:04 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> On Fri, Mar 20, 2015 at 1:30 PM, Ulrich Hecht
> <ulrich.hecht+renesas@gmail.com> wrote:
> > --- a/drivers/pinctrl/sh-pfc/pfc-r8a7778.c
> > +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7778.c

[...]
>
> > +static unsigned int r8a7778_pinmux_get_bias(struct sh_pfc *pfc,
> > +                                           unsigned int pin)
> > +{
> > +       void __iomem *addr;
> > +
> > +       BUG_ON(!pullups[pin].reg);
>
> This looks a bit strong to me.
>
> As pinconf_ops.pin_config_[gs]et() do return error codes, perhaps
> sh_pfc_soc_operations.[gs]et_bias() should be changed to allow the
> return of error codes, too, so you can return -ENOTSUPP here?
>
> If you really feel the need to scream, I'd use WARN_ON_ONCE() instead.


I don't know... These methods are only supposed to be called for pins
that are configured as biasable (with an SH_PFC_PIN_CFG_PULL_UP flag,
for instance). If a pin isn't, sh_pfc_pinconf_get() returns -ENOTSUPP.

So if we encounter a pin we don't know how to handle, either the flag
is set incorrectly, or the table is missing an entry. I'd call either
of these cases a bug.

CU
Uli

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-30 11:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 11:38 Fwd: [PATCH 2/3] pinctrl: sh-pfc: r8a7778: Add bias (pull-up) pinconf support Ulrich Hecht

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).