From: Stephen Boyd <swboyd@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
patches@lists.linux.dev, chrome-platform@lists.linux.dev,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org, Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Hsin-Yi Wang <hsinyi@chromium.org>,
"Joseph S. Barrera III" <joebar@chromium.org>
Subject: Re: [PATCH v3 2/2] Input: cros-ec-keyb - skip keyboard registration w/o cros-ec-keyb compatible
Date: Tue, 3 May 2022 12:43:31 -0700 [thread overview]
Message-ID: <CAE-0n52xsyFPKiFufS=+S5QMqYoLN=2MOZHWJ7E9orJyCs3=ig@mail.gmail.com> (raw)
In-Reply-To: <CAD=FV=XDHwOeQOFevwH9rfd=UN9OcEoOS=HeydYnNAZMUdCaBQ@mail.gmail.com>
Quoting Doug Anderson (2022-05-03 08:09:11)
> On Mon, May 2, 2022 at 9:22 PM Stephen Boyd <swboyd@chromium.org> wrote:
> >
> > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> > index eef909e52e23..04c550aaf897 100644
> > --- a/drivers/input/keyboard/cros_ec_keyb.c
> > +++ b/drivers/input/keyboard/cros_ec_keyb.c
> > @@ -536,14 +536,11 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev)
> > u32 *physmap;
> > u32 key_pos;
> > unsigned int row, col, scancode, n_physmap;
> > + bool register_keyboard;
> >
> > - /*
> > - * No rows and columns? There isn't a matrix but maybe there are
> > - * switches to register in cros_ec_keyb_register_bs() because
> > - * this is a detachable device.
> > - */
> > - if (!device_property_present(dev, "keypad,num-rows") &&
> > - !device_property_present(dev, "keypad,num-cols"))
> > + /* Skip matrix registration if no keyboard */
> > + register_keyboard = device_get_match_data(dev);
> > + if (!register_keyboard)
> > return 0;
>
> I'm a little on the fence about the local variable. It could have been
> shorter as:
>
> /* Skip matrix registration if no keyboard */
> if (!device_get_match_data(dev))
>
> ...but I guess the "register_keyboard" maybe makes it more a little
> more obvious?
Yes, the idea is to make it more obvious to the point that the comment
isn't needed. I'll change it to 'has_keyboard' and then drop the
comment!
>
> In any case, I'm happy either way:
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
prev parent reply other threads:[~2022-05-03 19:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 4:22 [PATCH v3 0/2] Input: cros-ec-keyb: Better matrixless support Stephen Boyd
2022-05-03 4:22 ` [PATCH v3 1/2] dt-bindings: google,cros-ec-keyb: Introduce switches only compatible Stephen Boyd
2022-05-03 15:09 ` Doug Anderson
2022-05-03 19:40 ` Stephen Boyd
2022-05-03 15:42 ` Krzysztof Kozlowski
2022-05-03 15:46 ` Doug Anderson
2022-05-03 15:54 ` Krzysztof Kozlowski
2022-05-03 16:14 ` Doug Anderson
2022-05-03 18:45 ` Krzysztof Kozlowski
2022-05-03 19:00 ` Stephen Boyd
2022-05-03 19:02 ` Krzysztof Kozlowski
2022-05-03 4:22 ` [PATCH v3 2/2] Input: cros-ec-keyb - skip keyboard registration w/o cros-ec-keyb compatible Stephen Boyd
2022-05-03 15:09 ` Doug Anderson
2022-05-03 19:43 ` Stephen Boyd [this message]
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='CAE-0n52xsyFPKiFufS=+S5QMqYoLN=2MOZHWJ7E9orJyCs3=ig@mail.gmail.com' \
--to=swboyd@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=groeck@chromium.org \
--cc=hsinyi@chromium.org \
--cc=joebar@chromium.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=robh+dt@kernel.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).