Revert "USB: appledisplay: close race between probe and completion handler"

This reverts commit 4445d6f605.
This commit is contained in:
Ksawlii 2024-11-24 00:23:17 +01:00
parent 3bc02f320d
commit 9d9cb51ef7

View file

@ -107,12 +107,7 @@ static void appledisplay_complete(struct urb *urb)
case ACD_BTN_BRIGHT_UP:
case ACD_BTN_BRIGHT_DOWN:
pdata->button_pressed = 1;
/*
* there is a window during which no device
* is registered
*/
if (pdata->bd )
schedule_delayed_work(&pdata->work, 0);
schedule_delayed_work(&pdata->work, 0);
break;
case ACD_BTN_NONE:
default:
@ -207,7 +202,6 @@ static int appledisplay_probe(struct usb_interface *iface,
const struct usb_device_id *id)
{
struct backlight_properties props;
struct backlight_device *backlight;
struct appledisplay *pdata;
struct usb_device *udev = interface_to_usbdev(iface);
struct usb_endpoint_descriptor *endpoint;
@ -278,14 +272,13 @@ static int appledisplay_probe(struct usb_interface *iface,
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.max_brightness = 0xff;
backlight = backlight_device_register(bl_name, NULL, pdata,
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
&appledisplay_bl_data, &props);
if (IS_ERR(backlight)) {
if (IS_ERR(pdata->bd)) {
dev_err(&iface->dev, "Backlight registration failed\n");
retval = PTR_ERR(backlight);
retval = PTR_ERR(pdata->bd);
goto error;
}
pdata->bd = backlight;
/* Try to get brightness */
brightness = appledisplay_bl_get_brightness(pdata->bd);