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: raspberrypi-ts - use cleanup facility for device_node

Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-9-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Javier Carrasco and committed by
Dmitry Torokhov
cd63c67b 6243376d

+1 -3
+1 -3
drivers/input/touchscreen/raspberrypi-ts.c
··· 122 122 struct device *dev = &pdev->dev; 123 123 struct device_node *np = dev->of_node; 124 124 struct input_dev *input; 125 - struct device_node *fw_node; 126 125 struct rpi_firmware *fw; 127 126 struct rpi_ts *ts; 128 127 u32 touchbuf; 129 128 int error; 130 129 131 - fw_node = of_get_parent(np); 130 + struct device_node *fw_node __free(device_node) = of_get_parent(np); 132 131 if (!fw_node) { 133 132 dev_err(dev, "Missing firmware node\n"); 134 133 return -ENOENT; 135 134 } 136 135 137 136 fw = devm_rpi_firmware_get(&pdev->dev, fw_node); 138 - of_node_put(fw_node); 139 137 if (!fw) 140 138 return -EPROBE_DEFER; 141 139