linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Richard Walmsley <richwalm@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] input: DragonRise Inc. game controller force feedback support
Date: Sat, 28 Feb 2009 14:15:50 -0800	[thread overview]
Message-ID: <20090228141046.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <167575d80902261744h3d133416g1afeb5b68d760cbf@mail.gmail.com>

Hi Richard,

On Fri, Feb 27, 2009 at 02:44:11PM +1300, Richard Walmsley wrote:
> Adds force feedback support for USB DragonRise Inc. game controllers.
> These devices are mass produced in China and distributed under several vendors.
> 

Looks pretty good, however it shoudl go through Jiri Kosina (CCed).

> +
> +static int drff_init(struct hid_device *hid)
> +{
> +	struct drff_device *drff;
> +	struct hid_report *report;
> +	struct hid_input *hidinput = list_entry(hid->inputs.next,
> +						struct hid_input, list);

list_first_entry()?

> +	struct list_head *report_list =
> +			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
> +	struct list_head *report_ptr = report_list;
> +	struct input_dev *dev = hidinput->input;
> +	int error;
> +
> +	if (list_empty(report_list)) {
> +		dev_err(&hid->dev, "no output reports found\n");
> +		return -ENODEV;
> +	}
> +
> +	report_ptr = report_ptr->next;
> +
> +	report = list_entry(report_ptr, struct hid_report, list);

You might want to simply use list_first_entry() for this.

-- 
Dmitry

  reply	other threads:[~2009-02-28 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27  1:44 [PATCH] input: DragonRise Inc. game controller force feedback support Richard Walmsley
2009-02-28 22:15 ` Dmitry Torokhov [this message]
2009-03-03  3:47   ` Richard Walmsley

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=20090228141046.ZZRA012@mailhub.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=richwalm@gmail.com \
    /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).