mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: simon@mungewell.org
To: "Jiri Kosina" <jkosina@suse.cz>
Cc: "Simon Wood" <simon@mungewell.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	rosegardener@freeode.co.uk
Subject: Re: [PATCH 4/4] USB: HID: SRW-S1 Add support controlling all LEDs simultaneously
Date: Mon, 28 Jan 2013 10:24:19 -0500	[thread overview]
Message-ID: <6b10e63f6686b4b0d05ec7ccd896f39e.squirrel@mungewell.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1301281601370.23853@pobox.suse.cz>

> On Thu, 24 Jan 2013, Simon Wood wrote:
>
>> From: simon <simon@simon-virtual-machine.(none)>
>>
>> This patch to the SRW-S1 driver adds the ability to control all
>> LEDs simultaneously as testing showed that it was slow (noticably!!)
>> when seting or clearing all the LEDs in turn.
>>
>> It adds a 'RPMALL' LED, whose behavoir is asserted to all the LEDs in
>> the bar graph, individual LEDs can subsequently be turned on/off
>> individually.
>>
>> Signed-off-by: Simon Wood <simon@mungewell.org>
>> tested-by: John Murphy <rosegardener@freeode.co.uk>
> [ ... snip ... ]
>
>> @@ -219,13 +255,34 @@ static int srws1_probe(struct hid_device *hdev,
>>
>>  	/* register led subsystem */
>>  	drv_data->led_state = 0;
>> -	for (i = 0; i < SRWS1_NUMBER_LEDS; i++)
>> +	for (i = 0; i < SRWS1_NUMBER_LEDS + 1; i++)
>>  		drv_data->led[i] = NULL;
>>
>>  	srws1_set_leds(hdev, 0);
>>
>> -	name_sz = strlen(hdev->uniq) + 15;
>> +	name_sz = strlen(hdev->uniq) + 16;
>> +
>> +	/* 'ALL', for setting all LEDs simultaneously */
>> +	led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
>
> Is this memory ever freed?

Yes. The pointer to it is stored at the end of the drv_data leds[] array
(line 280), and will be free'd on probe fail (line 314) or when device is
removed (line 341).

Simon


  reply	other threads:[~2013-01-28 15:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25  6:34 [PATCH 1/4] USB: HID: SRW-S1 Gaming Wheel Driver Simon Wood
2013-01-25  6:34 ` [PATCH 2/4] USB: HID: SRW-S1 Add support for dials Simon Wood
2013-01-25  6:34 ` [PATCH 3/4] USB: HID: SRW-S1 Add support for LEDs Simon Wood
2013-01-25  6:34 ` [PATCH 4/4] USB: HID: SRW-S1 Add support controlling all LEDs simultaneously Simon Wood
2013-01-28 15:02   ` Jiri Kosina
2013-01-28 15:24     ` simon [this message]
2013-01-28 14:59 ` [PATCH 1/4] USB: HID: SRW-S1 Gaming Wheel Driver Jiri Kosina
2013-01-28 15:38   ` simon
2013-01-28 16:56     ` Jiri Kosina
2013-01-28 17:00       ` simon
2013-01-29  9:57         ` Jiri Kosina
2013-01-31 15:07           ` [PATCH 1/5] " Simon Wood
2013-01-31 15:07             ` [PATCH 2/5] USB: HID: Steelseries SRW-S1 Add support for dials Simon Wood
2013-01-31 15:07             ` [PATCH 3/5] USB: HID: Steelseries SRW-S1 Add support for LEDs Simon Wood
2013-01-31 15:07             ` [PATCH 4/5] USB: HID: Steelseries SRW-S1 Add support controlling all LEDs simultaneously Simon Wood
2013-01-31 15:15             ` [PATCH 1/5] USB: HID: SRW-S1 Gaming Wheel Driver simon
2013-01-31 15:23             ` Jiri Kosina
2013-01-31 15:36               ` simon
2013-01-31 15:54                 ` Jiri Kosina
2013-01-31 16:15                   ` simon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b10e63f6686b4b0d05ec7ccd896f39e.squirrel@mungewell.org \
    --to=simon@mungewell.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosegardener@freeode.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®