Skip to content

Commit 30a8401

Browse files
topdjgodjamess-huang
authored andcommitted
Fix usecount issue for of_fwnode_graph_get_port_parent()
Using CONFIG_OF_DYNAMIC=y uncovered an imbalance in the usecount of the node being passed to of_fwnode_graph_get_port_parent(). Preserve the usecount by using of_get_parent() instead of of_get_next_parent() which don't decrement the usecount of the node passed to it. Change-Id: Idab6b15bcfa7249544ad93a3efd843d6896e1de0 Reviewed-on: https://tp-biosrd-v02/gerrit/82403 Reviewed-by: Jamess Huang(黃以民) <Jamess_Huang@asus.com> Tested-by: Jamess Huang(黃以民) <Jamess_Huang@asus.com>
1 parent 58c1b9e commit 30a8401

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

arch/arm/boot/dts/rk3288-miniarm.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
compatible = "ovti,ov5647";
532532
reg = <0x36>;
533533
clocks = <&ext_cam_clk>;
534-
status = "okay";
534+
status = "disabled";
535535
};
536536

537537
camera1: imx219@10 {

arch/arm/configs/miniarm-rk3288_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,15 @@ CONFIG_OF=y
368368
CONFIG_OF_UNITTEST=y
369369
CONFIG_OF_FLATTREE=y
370370
CONFIG_OF_EARLY_FLATTREE=y
371+
CONFIG_OF_DYNAMIC=y
371372
CONFIG_OF_ADDRESS=y
372373
CONFIG_OF_IRQ=y
373374
CONFIG_OF_NET=y
374375
CONFIG_OF_MDIO=y
375376
CONFIG_OF_RESERVED_MEM=y
376377
CONFIG_OF_RESOLVE=y
378+
CONFIG_OF_OVERLAY=y
379+
CONFIG_OF_CONFIGFS=y
377380
CONFIG_SCSI=y
378381
CONFIG_BLK_DEV_SD=y
379382
CONFIG_BLK_DEV_SR=y

drivers/of/property.c

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode)
900900
struct device_node *np;
901901

902902
/* Get the parent of the port */
903-
np = of_get_next_parent(to_of_node(fwnode));
903+
np = of_get_parent(to_of_node(fwnode));
904904
if (!np)
905905
return NULL;
906906

0 commit comments

Comments
 (0)