<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/input/keyboard/gpio_keys_polled.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-11-09T13:55:33Z</updated>
<entry>
<title>Input: gpio_keys_polled - avoid using GPIOF_ACTIVE_LOW</title>
<updated>2024-11-09T13:55:33Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2024-11-04T09:34:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=081aaf2dfcfa10fa5cb5444b77b154cce4355708'/>
<id>urn:sha1:081aaf2dfcfa10fa5cb5444b77b154cce4355708</id>
<content type='text'>
Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20241104093609.156059-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - use device_for_each_child_node_scoped()</title>
<updated>2024-07-16T00:02:13Z</updated>
<author>
<name>Javier Carrasco</name>
<email>javier.carrasco.cruz@gmail.com</email>
</author>
<published>2024-04-12T20:57:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1102db75c5ce9df1214ba06b69e00f6fe4dc19c1'/>
<id>urn:sha1:1102db75c5ce9df1214ba06b69e00f6fe4dc19c1</id>
<content type='text'>
Switch to the _scoped() version introduced in commit 365130fd47af
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco &lt;javier.carrasco.cruz@gmail.com&gt;
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-4-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - suppress deferred probe error for gpio</title>
<updated>2024-03-05T17:16:37Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-03-05T10:10:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=963465a33141d0d52338e77f80fe543d2c9dc053'/>
<id>urn:sha1:963465a33141d0d52338e77f80fe543d2c9dc053</id>
<content type='text'>
On a PC Engines APU our admins are faced with:

	$ dmesg | grep -c "gpio-keys-polled gpio-keys-polled: unable to claim gpio 0, err=-517"
	261

Such a message always appears when e.g. a new USB device is plugged in.

Suppress this message which considerably clutters the kernel log for
EPROBE_DEFER (i.e. -517).

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20240305101042.10953-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - simplify with dev_err_probe()</title>
<updated>2023-07-07T23:54:26Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2023-06-25T16:27:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=caec3d4416a2fbd7399556ba366da4d8fc05d9f5'/>
<id>urn:sha1:caec3d4416a2fbd7399556ba366da4d8fc05d9f5</id>
<content type='text'>
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20230625162817.100397-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - replace zero-length array with flexible-array member</title>
<updated>2020-02-15T01:19:19Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2020-02-15T01:01:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d87c75d84e20d8812dbfba87e46ffca29d75d40'/>
<id>urn:sha1:3d87c75d84e20d8812dbfba87e46ffca29d75d40</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;
Link: https://lore.kernel.org/r/20200214171907.GA26588@embeddedor
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - switch to using polled mode of input devices</title>
<updated>2019-10-30T00:13:45Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2019-10-29T23:55:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9584bded0ba886b13a41eb25e0ed1431c2191979'/>
<id>urn:sha1:9584bded0ba886b13a41eb25e0ed1431c2191979</id>
<content type='text'>
We have added polled mode to the normal input devices with the intent of
retiring input_polled_dev. This converts gpio_keys_polled driver to use
the polling mode of standard input devices and removes dependency on
INPUT_POLLDEV.

Note that we still keep polled and non-polled gpio-keys drivers separate,
as they are different enough and mixing them up would make the code pretty
confusing.

Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Marco Felsch &lt;m.felsch@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20191017204217.106453-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - switch to using devm_fwnode_gpiod_get()</title>
<updated>2019-10-27T18:12:47Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2019-09-14T00:43:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5f92dcee81f4fb7375ec3cedc48dfb042cf492b2'/>
<id>urn:sha1:5f92dcee81f4fb7375ec3cedc48dfb042cf492b2</id>
<content type='text'>
devm_fwnode_get_gpiod_from_child() is going away as the name is too
unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v5.2' into next</title>
<updated>2019-07-15T16:42:32Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2019-07-15T16:42:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ecb41832bd2a7a3f8ac93527cec5e51e3827daed'/>
<id>urn:sha1:ecb41832bd2a7a3f8ac93527cec5e51e3827daed</id>
<content type='text'>
Sync up with mainline to resolve conflicts in iforce driver.
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - allow specifying name of input device</title>
<updated>2019-07-07T06:12:29Z</updated>
<author>
<name>Enrico Weigelt, metux IT consult</name>
<email>info@metux.net</email>
</author>
<published>2019-07-07T05:55:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=593fdd4fb44ef2cbf4ec53ec2c6eb60eb079bb4c'/>
<id>urn:sha1:593fdd4fb44ef2cbf4ec53ec2c6eb60eb079bb4c</id>
<content type='text'>
Instead of hardcoding the input name to the driver name
('gpio-keys-polled'), allow specifying the name of the device via
"label" property. If the property is not present (nor name is set in
board-supplied platform data), we'll default to the old name.

Signed-off-by: Enrico Weigelt, metux IT consult &lt;info@metux.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys_polled - use struct_size() in devm_kzalloc()</title>
<updated>2019-06-23T06:34:57Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-06-23T06:33:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d4149ec87fdab5006cb94f8ebe4720b1ee7e564'/>
<id>urn:sha1:3d4149ec87fdab5006cb94f8ebe4720b1ee7e564</id>
<content type='text'>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct gpio_keys_polled_dev {
	...
        struct gpio_keys_button_data data[0];
};

size = sizeof(struct gpio_keys_polled_dev) + count * sizeof(struct gpio_keys_button_data);
instance = devm_kzalloc(dev, size, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = devm_kzalloc(dev, struct_size(instance, data, count), GFP_KERNEL);

Notice that, in this case, variable size is not necessary, hence it
is removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
</feed>
