<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/leds, branch v5.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-04-06T21:12:08Z</updated>
<entry>
<title>leds: core: Fix warning message when init_data</title>
<updated>2020-04-06T21:12:08Z</updated>
<author>
<name>Ricardo Ribalda Delgado</name>
<email>ribalda@kernel.org</email>
</author>
<published>2020-04-01T09:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64ed6588c2ea618d3f9ca9d8b365ae4c19f76225'/>
<id>urn:sha1:64ed6588c2ea618d3f9ca9d8b365ae4c19f76225</id>
<content type='text'>
The warning message when a led is renamed due to name collition can fail
to show proper original name if init_data is used. Eg:

[    9.073996] leds-gpio a0040000.leds_0: Led (null) renamed to red_led_1 due to name collision

Fixes: bb4e9af0348d ("leds: core: Add support for composing LED class device names")
Signed-off-by: Ricardo Ribalda Delgado &lt;ribalda@kernel.org&gt;
Acked-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: sort Makefile entries</title>
<updated>2020-04-06T20:57:10Z</updated>
<author>
<name>Pavel Machek</name>
<email>pavel@ucw.cz</email>
</author>
<published>2020-03-21T16:09:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=457386350e6a49e0b26ad7e2f303bb81e094d4a2'/>
<id>urn:sha1:457386350e6a49e0b26ad7e2f303bb81e094d4a2</id>
<content type='text'>
Sort Makefile entries to reduce risk of rejects.

Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: ip30: label power LED as such</title>
<updated>2020-04-06T20:44:19Z</updated>
<author>
<name>Pavel Machek</name>
<email>pavel@ucw.cz</email>
</author>
<published>2020-03-21T16:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=19aa98409066b6e0f1f7ecfb404a983724f946f0'/>
<id>urn:sha1:19aa98409066b6e0f1f7ecfb404a983724f946f0</id>
<content type='text'>
Make label "white:power" to be consistent with dt-bindings/leds/common.h .

Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: lm3532: make bitfield 'enabled' unsigned</title>
<updated>2020-04-06T20:44:18Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2020-03-13T17:19:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28799272acbf385d820b1fa86bd43a80aedd51fa'/>
<id>urn:sha1:28799272acbf385d820b1fa86bd43a80aedd51fa</id>
<content type='text'>
The bitfield 'enabled' should bit unsigned, so make it unsigned.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: leds-pwm: Replace zero-length array with flexible-array member</title>
<updated>2020-03-21T15:21:16Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2020-03-19T21:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7bbec6c4b51d2323459203510028e8344f79e126'/>
<id>urn:sha1:7bbec6c4b51d2323459203510028e8344f79e126</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: leds-is31fl32xx: Replace zero-length array with flexible-array member</title>
<updated>2020-03-21T15:21:16Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2020-03-19T21:51:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a630367759869612a3a7aec76cff4b436b7f9aa'/>
<id>urn:sha1:7a630367759869612a3a7aec76cff4b436b7f9aa</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: pwm: remove useless pwm_period_ns</title>
<updated>2020-03-21T15:17:53Z</updated>
<author>
<name>Denis Osterland-Heim</name>
<email>denis.osterland@diehl.com</email>
</author>
<published>2020-03-21T08:15:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4227685b4dda61a3c0d2f10d50d364cb9c1a669d'/>
<id>urn:sha1:4227685b4dda61a3c0d2f10d50d364cb9c1a669d</id>
<content type='text'>
This member seems to was a way to pass PWM period to the LED.
Since there is no header anymore, this is useless.

Signed-off-by: Denis Osterland-Heim &lt;Denis.Osterland@diehl.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: pwm: remove header</title>
<updated>2020-03-21T15:17:53Z</updated>
<author>
<name>Denis Osterland-Heim</name>
<email>denis.osterland@diehl.com</email>
</author>
<published>2020-03-21T08:15:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=141f15c66d9472c642f38aae010ed68289036d7c'/>
<id>urn:sha1:141f15c66d9472c642f38aae010ed68289036d7c</id>
<content type='text'>
The header is only used by leds_pwm.c, so move contents to leds_pwm.c
and remove it.
Apply minor changes suggested by checkpatch.
Remove deprecated and unused pwm_id member.

Suggested-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Denis Osterland-Heim &lt;Denis.Osterland@diehl.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: pwm: convert to atomic PWM API</title>
<updated>2020-02-26T20:49:39Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2020-01-24T16:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dd47a83453e4a5b0d6a91fe702b7fbc1984fb610'/>
<id>urn:sha1:dd47a83453e4a5b0d6a91fe702b7fbc1984fb610</id>
<content type='text'>
pwm_config(), pwm_enable() and pwm_disable() should get removed in the
long run. So update the driver to use the atomic API that is here to
stay.

A few side effects:

 - led_pwm_set() now returns an error when setting the PWM fails.
 - During .probe() the PWM isn't disabled implicitly by pwm_apply_args()
   any more.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Tested-by: Jeff LaBundy &lt;jeff@labundy.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: pwm: simplify if condition</title>
<updated>2020-02-26T20:49:39Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2020-01-24T16:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b43a8f01fccbfdddbc7f9b2bbad11b7db3fda4e1'/>
<id>urn:sha1:b43a8f01fccbfdddbc7f9b2bbad11b7db3fda4e1</id>
<content type='text'>
.pwm_period_ns is an unsigned integer. So when led-&gt;pwm_period_ns &gt; 0
is false, we now assign 0 to a value that is already 0, so it doesn't
hurt and we can skip checking the actual value.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Tested-by: Jeff LaBundy &lt;jeff@labundy.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
</feed>
