From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Greg Tulli <greg.iforce@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH v2] Input: iforce - add missing vendor and product ids to the Unknown device name
Date: Mon, 29 Aug 2022 11:19:08 -0700 [thread overview]
Message-ID: <Yw0DHEQ4yQa60OzA@google.com> (raw)
In-Reply-To: <edc347e3-52d8-9621-c3f1-5c3872d95fcb@gmail.com>
Hi Greg,
On Mon, Aug 29, 2022 at 11:45:18AM +0200, Greg Tulli wrote:
>
> An unknown iforce device is named "Unknown I-Force Device
> [%04x:%04x]". The vendor and product ids should be substituted.
>
> Signed-off-by: Greg Tulli <greg.iforce@gmail.com>
> ---
>
> diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
> index b2a68bc9f0b4..6de5d06d2bd0 100644
> --- a/drivers/input/joystick/iforce/iforce-main.c
> +++ b/drivers/input/joystick/iforce/iforce-main.c
> @@ -323,7 +323,11 @@ int iforce_init_device(struct device *parent, u16 bustype,
> break;
>
> iforce->type = iforce_device + i;
> - input_dev->name = iforce->type->name;
> + if (iforce_device[i].idvendor)
If we are using iforce->type then we should say
if (iforce->type->idVendor)
> + input_dev->name = iforce->type->name;
> + else
> + input_dev->name = devm_kasprintf(parent, GFP_KERNEL, iforce->type->name,
> + input_dev->id.vendor, input_dev->id.product);
This needs error handling.
>
> /*
> * Set input device bitfields and ranges.
Thanks.
--
Dmitry
prev parent reply other threads:[~2022-08-29 18:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-28 23:56 [PATCH] Input: iforce - add missing vendor and product ids to the Unknown device name Greg Tulli
2022-08-29 9:45 ` [PATCH v2] " Greg Tulli
2022-08-29 18:19 ` Dmitry Torokhov [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=Yw0DHEQ4yQa60OzA@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=greg.iforce@gmail.com \
--cc=linux-input@vger.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).