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

Configure Feed

Select the types of activity you want to include in your feed.

Input: iqs269a - use cleanup facility for fwnodes

Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044806.1047847-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+3 -6
+3 -6
drivers/input/misc/iqs269a.c
··· 550 550 const struct fwnode_handle *ch_node) 551 551 { 552 552 struct i2c_client *client = iqs269->client; 553 - struct fwnode_handle *ev_node; 554 553 struct iqs269_ch_reg *ch_reg; 555 554 u16 engine_a, engine_b; 556 555 unsigned int reg, val; ··· 726 727 } 727 728 728 729 for (i = 0; i < ARRAY_SIZE(iqs269_events); i++) { 729 - ev_node = fwnode_get_named_child_node(ch_node, 730 - iqs269_events[i].name); 730 + struct fwnode_handle *ev_node __free(fwnode_handle) = 731 + fwnode_get_named_child_node(ch_node, 732 + iqs269_events[i].name); 731 733 if (!ev_node) 732 734 continue; 733 735 ··· 737 737 dev_err(&client->dev, 738 738 "Invalid channel %u threshold: %u\n", 739 739 reg, val); 740 - fwnode_handle_put(ev_node); 741 740 return -EINVAL; 742 741 } 743 742 ··· 750 751 dev_err(&client->dev, 751 752 "Invalid channel %u hysteresis: %u\n", 752 753 reg, val); 753 - fwnode_handle_put(ev_node); 754 754 return -EINVAL; 755 755 } 756 756 ··· 765 767 } 766 768 767 769 error = fwnode_property_read_u32(ev_node, "linux,code", &val); 768 - fwnode_handle_put(ev_node); 769 770 if (error == -EINVAL) { 770 771 continue; 771 772 } else if (error) {