[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <484D08AA.1080300@gmail.com>
Date: Mon, 09 Jun 2008 12:40:42 +0200
From: Jiri Slaby <jirislaby@...il.com>
To: Jiri Kosina <jkosina@...e.cz>
CC: Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, marcel@...tmann.org,
linux-kernel@...r.kernel.org, anssi.hannula@...il.com
Subject: Re: [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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists