[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806041610240.10085@jikos.suse.cz>
Date:	Wed, 4 Jun 2008 16:13:37 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Jiri Slaby <jirislaby@...il.com>
cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	linux-input@...r.kernel.org, marcel@...tmann.org,
	linux-kernel@...r.kernel.org, anssi.hannula@...il.com,
	Jiri Slaby <jslaby@...e.cz>
Subject: Re: [PATCH 08/10] HID: move apple quirks
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?
Or am I just horribly overlooking something?
Thanks,
-- 
Jiri Kosina
SUSE Labs
--
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
 
