Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: iqs269a - use device_for_each_child_node_scoped()

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 <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-1-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Javier Carrasco and committed by
Dmitry Torokhov
4256d472 3daee2e4

+2 -5
+2 -5
drivers/input/misc/iqs269a.c
··· 811 811 { 812 812 struct iqs269_sys_reg *sys_reg = &iqs269->sys_reg; 813 813 struct i2c_client *client = iqs269->client; 814 - struct fwnode_handle *ch_node; 815 814 u16 general, misc_a, misc_b; 816 815 unsigned int val; 817 816 int error; ··· 1048 1049 1049 1050 sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS); 1050 1051 1051 - device_for_each_child_node(&client->dev, ch_node) { 1052 + device_for_each_child_node_scoped(&client->dev, ch_node) { 1052 1053 error = iqs269_parse_chan(iqs269, ch_node); 1053 - if (error) { 1054 - fwnode_handle_put(ch_node); 1054 + if (error) 1055 1055 return error; 1056 - } 1057 1056 } 1058 1057 1059 1058 /*