Re: [PATCH] input: DragonRise Inc. game controller force feedback support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux