Skip to content

Commit 4256d47

Browse files
javiercarrascocruzdtor
authored andcommitted
Input: iqs269a - use device_for_each_child_node_scoped()
Switch to the _scoped() version introduced in commit 365130f ("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>
1 parent 3daee2e commit 4256d47

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/input/misc/iqs269a.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269)
811811
{
812812
struct iqs269_sys_reg *sys_reg = &iqs269->sys_reg;
813813
struct i2c_client *client = iqs269->client;
814-
struct fwnode_handle *ch_node;
815814
u16 general, misc_a, misc_b;
816815
unsigned int val;
817816
int error;
@@ -1049,12 +1048,10 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269)
10491048

10501049
sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS);
10511050

1052-
device_for_each_child_node(&client->dev, ch_node) {
1051+
device_for_each_child_node_scoped(&client->dev, ch_node) {
10531052
error = iqs269_parse_chan(iqs269, ch_node);
1054-
if (error) {
1055-
fwnode_handle_put(ch_node);
1053+
if (error)
10561054
return error;
1057-
}
10581055
}
10591056

10601057
/*

0 commit comments

Comments
 (0)