From: david@lechnology.com (David Lechner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0
Date: Mon, 22 Jan 2018 11:06:18 -0600 [thread overview]
Message-ID: <d1426fbc-bc82-89cd-d08d-242b16d2c99d@lechnology.com> (raw)
In-Reply-To: <CAHp75VdkShHhxL+3PyaPEC2Dyr8aWoEH8CQk+bEJ2WD4i6ojHg@mail.gmail.com>
On 01/22/2018 08:49 AM, Andy Shevchenko wrote:
> On Mon, Jan 22, 2018 at 1:03 AM, David Lechner <david@lechnology.com> wrote:
>> This fixes pcs_request_gpio() in the pinctrl-single driver when
>> bits_per_mux != 0. It appears this was overlooked when the multiple
>> pins per register feature was added.
>>
>> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure
>> multiple pins of different modules")
>
> One line?
One line is more important that wrapping to 75 chars?
>
>> + byte_num = (pcs->bits_per_pin * pin) / BITS_PER_BYTE;
>> + offset = (byte_num / mux_bytes) * mux_bytes;
>> + pin_shift = pin % (pcs->width / pcs->bits_per_pin) *
>> + pcs->bits_per_pin;
>
> Sounds like playing around pretty well defined macro and functions,
> e.g. DIV_ROUND_UP(), round_up().
>
I admit, I just copied existing code (which may be a reason to leave this the
way it is). But, I only see once place to do this:
offset = round_down(byte_num, mux_bytes);
Did I miss another?
next prev parent reply other threads:[~2018-01-22 17:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-21 23:03 [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0 David Lechner
2018-01-22 14:49 ` Andy Shevchenko
2018-01-22 17:06 ` David Lechner [this message]
2018-01-23 9:25 ` Andy Shevchenko
2018-01-23 17:45 ` Tony Lindgren
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=d1426fbc-bc82-89cd-d08d-242b16d2c99d@lechnology.com \
--to=david@lechnology.com \
--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).