# Re: \[RFC 11/12\] HID: wiimote: Cache wiimote led state

- From: Oliver Neukum \<oliver@neukum.org\>
- Date: 2011-06-15 06:42:19 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/06/8916964
- Thread: https://ratatoskr.run/linux-input/2011/06/8916946/t.md

```text
Am Mittwoch, 15. Juni 2011, 01:45:56 schrieb David Herrmann:
> @@ -319,7 +340,12 @@ static int wiimote_hid_probe(struct hid_device *hdev,
>  
>         atomic_set(&wdata->ready, 1);
>         hid_info(hdev, "New device registered\n");
> +
> +       /* by default set led1 after device initialization */
> +       spin_lock(&wdata->state.lock);

spin_lock_irq() or you might deadlock.

>         wiiproto_req_leds(wdata, WIIPROTO_FLAG_LED1);
> +       spin_unlock(&wdata->state.lock);
> +
>         return 0;

	Regards
		Oliver
```
