lkml.org 
[lkml]   [2008]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/10] HID: move apple quirks
On 06/04/2008 04:13 PM, Jiri Kosina wrote:
> On Fri, 16 May 2008, Jiri Slaby wrote:
>
>
>> +static int apple_probe(struct hid_device *hdev,
>> + const struct hid_device_id *id)
>> +{
>> + unsigned long quirks = id->driver_data;
>> + struct apple_sc *asc;
>> + int ret;
>> +
>> + /* return something else or move to hid layer? device will reside
>> + allocated */
>> + if (id->bus == BUS_USB && (id->driver_data & APPLE_IGNORE_MOUSE) &&
>> + to_usb_interface(hdev->dev.parent)->cur_altsetting->
>> + desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE)
>> + return -ENODEV;
>> +
>> + asc = kzalloc(sizeof(*asc), GFP_KERNEL);
>> + if (asc == NULL) {
>> + dev_err(&hdev->dev, "can't alloc apple descriptor\n");
>> + return -ENOMEM;
>> + }
>> +
>> + hid_set_drvdata(hdev, asc);
>> +
>> + if (quirks & APPLE_HIDDEV)
>> + hdev->quirks |= HID_QUIRK_HIDDEV;
>> + if (quirks & APPLE_IGNORE_HIDINPUT)
>> + hdev->quirks |= HID_QUIRK_IGNORE_HIDINPUT;
>> +
>> + ret = hid_parse(hdev);
>> + if (ret) {
>> + dev_err(&hdev->dev, "parse failed\n");
>> + goto err_free;
>> + }
>> +
>> + ret = hid_hw_start(hdev);
>> + if (ret) {
>> + dev_err(&hdev->dev, "hw start failed\n");
>> + goto err_free;
>> + }
>> +
>> + return 0;
>> +err_free:
>> + kfree(asc);
>> + return ret;
>> +}
>
> Hi Jiri,
>
> you don't seem to set asc->quirks anywhere, but the rest of the code is
> testing this flag. Is something like
>
> asc->quirks = id->driver_data;
>
> missing in the _probe routine?

Blah, good catch! Do you want me to post a patch, or will you fix this on your own?


\
 
 \ /
  Last update: 2008-06-09 12:45    [W:0.191 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site