public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] pinctrl: Replace list_groups() with get_groups_count()
Date: Thu, 29 Mar 2012 11:26:48 -0600	[thread overview]
Message-ID: <4F749B58.4070608@wwwdotorg.org> (raw)
In-Reply-To: <CAOh2x==LTHPM+O9LXVFVdX2NfzKs2bttiYLm8VcL6qLXKrUMBg@mail.gmail.com>

On 03/29/2012 10:34 AM, viresh kumar wrote:
> Most of the SoC drivers implement list_*() routines for pinctrl, pinmux,
> pinconf, etc, And these routines continue returning zero until the second
> argument is greater than total count of available groups, function, etc.
> 
> I will take struct pinctrl_ops as an example to elaborate my concern/doubts.
> 
> There are few concerns here:
> - list_groups() is called multiple times. If the purpose of this routine is to
>   only check the number of groups available, then why not remove it and create
>   another routine which returns number of total groups. Over which, we can run a
>   simple loop.
> - All client drivers have checks in their ops routines to check the range of
>   groups, which is just not required if we pass the correct number to pinctrl
>   framework. Because these ops are going to be called via pinctrl, and we can
>   trust on it and place these range checkers there only to make SoC drivers
>   simple.
> 
> I just wanted to have different views about my concerns/idea before i start
> coding. If this idea looks fine, i would do this change across pinmux framework.

The concept is fine by me.

I vaguely recall raising the same issue before, and Linus saying he
wanted to be consistent with similar list_*() functions in other
subsystems, but personally I'd prefer to evaluate this aspect of the
pinctrl subsystem on its own.

  reply	other threads:[~2012-03-29 17:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 16:34 [RFC] pinctrl: Replace list_groups() with get_groups_count() viresh kumar
2012-03-29 17:26 ` Stephen Warren [this message]
     [not found]   ` <CAOh2x==mGDZRoxdbuvbhKtfoxiEDVb+7vdfBEYD=u+DdMCYVhw@mail.gmail.com>
2012-03-29 17:48     ` Stephen Warren
2012-03-30  4:01       ` Viresh Kumar
2012-03-30  5:04         ` Linus Walleij
2012-03-30  5:09           ` Viresh Kumar
2012-03-30  5:14             ` Linus Walleij
2012-03-30  5:15               ` Viresh Kumar
2012-03-30  5:03       ` Linus Walleij
2012-04-02 16:30       ` Mark Brown

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=4F749B58.4070608@wwwdotorg.org \
    --to=swarren@wwwdotorg.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