Skip to content

Commit cd63c67

Browse files
javiercarrascocruzdtor
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 6243376 commit cd63c67

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/input/touchscreen/raspberrypi-ts.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,18 @@ static int rpi_ts_probe(struct platform_device *pdev)
122122
struct device *dev = &pdev->dev;
123123
struct device_node *np = dev->of_node;
124124
struct input_dev *input;
125-
struct device_node *fw_node;
126125
struct rpi_firmware *fw;
127126
struct rpi_ts *ts;
128127
u32 touchbuf;
129128
int error;
130129

131-
fw_node = of_get_parent(np);
130+
struct device_node *fw_node __free(device_node) = of_get_parent(np);
132131
if (!fw_node) {
133132
dev_err(dev, "Missing firmware node\n");
134133
return -ENOENT;
135134
}
136135

137136
fw = devm_rpi_firmware_get(&pdev->dev, fw_node);
138-
of_node_put(fw_node);
139137
if (!fw)
140138
return -EPROBE_DEFER;
141139

0 commit comments

Comments
 (0)