hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
Subsystems (2)
PATCH v2 1/1 hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument.
---
v2: use proper tags advised by Guenter and based on Kernel Doc
drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwmon/gsc-hwmon.c +1 -0
@@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev) pdata->nchannels = nchannels;/* fan controller base address */ +of_node_get (dev->parent->of_node); fan =of_find_compatible_node (dev->parent->of_node,NULL ,"gw,gsc-fan" );if (fan &&of_property_read_u32 (fan,"reg" , &pdata->fan_base)) {of_node_put (fan);
Signature · 1 line
2.25.1
Guenter Roeck
maintainerQuoted 8 lines · Liang He
In
gsc_hwmon_get_devtree_pdata(), we should callof_node_get()before theof_find_compatible_node()which will automatically callof_node_put()for the 'from' argument.Fixes 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")Co-developed-by Mengda Chen <[email protected]>Signed-off-by Mengda Chen <[email protected]>Signed-off-by Liang He <[email protected]>
Sigh. The first signer is supposed to be the author.
Guenter
Quoted 22 lines
---
v2: use proper tags advised by Guenter and based on Kernel Doc
drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+)drivers/hwmon/gsc-hwmon.c +1
-0@@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev) pdata->nchannels = nchannels;/* fan controller base address */ +of_node_get (dev->parent->of_node); fan =of_find_compatible_node (dev->parent->of_node,NULL ,"gw,gsc-fan" );if (fan &&of_property_read_u32 (fan,"reg" , &pdata->fan_base)) {of_node_put (fan);Signature · 1 line
2.25.1
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Liang He
In
gsc_hwmon_get_devtree_pdata(), we should callof_node_get()before theof_find_compatible_node()which will automatically callof_node_put()for the 'from' argument.
Quoted 8 lines
Quoted 4 lines
Fixes 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")Co-developed-by Mengda Chen <[email protected]>Signed-off-by Mengda Chen <[email protected]>Signed-off-by Liang He <[email protected]>Sigh. The first signer is supposed to be the author.
Guenter
Hi, Guenter
I search the commit history and found several recent but different commits
This one is same with mine: Co-developed-by: A & SOB First & SOB Author, following the kernel doc
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=7e97cfed9929eaabc41829c395eb0d1350fccb9d
But, this one is consistent with your advise: SOB Author & Co-developed-by: A & SOB A
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=ef69aa3a986ef94f01ce8b5b619f550db54432fe
So please tell me what I should follow?
Thanks very much.
Liang
Quoted 23 lines
Quoted 23 lines
---
v2: use proper tags advised by Guenter and based on Kernel Doc
drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+)drivers/hwmon/gsc-hwmon.c +1
-0@@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev) pdata->nchannels = nchannels;/* fan controller base address */ +of_node_get (dev->parent->of_node); fan =of_find_compatible_node (dev->parent->of_node,NULL ,"gw,gsc-fan" );if (fan &&of_property_read_u32 (fan,"reg" , &pdata->fan_base)) {of_node_put (fan);Signature · 1 line
2.25.1
Guenter Roeck
maintainerQuoted 19 lines · Liang He
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Liang He
In
gsc_hwmon_get_devtree_pdata(), we should callof_node_get()before theof_find_compatible_node()which will automatically callof_node_put()for the 'from' argument.Quoted 8 lines
Quoted 4 lines
Fixes 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")Co-developed-by Mengda Chen <[email protected]>Signed-off-by Mengda Chen <[email protected]>Signed-off-by Liang He <[email protected]>Sigh. The first signer is supposed to be the author.
Guenter
Hi, Guenter
Quoted 8 lines
I search the commit history and found several recent but different commits
This one is same with mine: Co-developed-by: A & SOB First & SOB Author, following the kernel doc
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=7e97cfed9929eaabc41829c395eb0d1350fccb9dBut, this one is consistent with your advise: SOB Author & Co-developed-by: A & SOB A
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=ef69aa3a986ef94f01ce8b5b619f550db54432fe
Yes, I know, one can always find an example for everything in the Linux kernel.
I expect the first signer to be the author, and the last signer to be the person who sent me the patch.
Guenter
Quoted 29 lines · Guenter Roeck
Quoted 19 lines · Liang He
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Liang He
In
gsc_hwmon_get_devtree_pdata(), we should callof_node_get()before theof_find_compatible_node()which will automatically callof_node_put()for the 'from' argument.Quoted 8 lines
Quoted 4 lines
Fixes 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")Co-developed-by Mengda Chen <[email protected]>Signed-off-by Mengda Chen <[email protected]>Signed-off-by Liang He <[email protected]>Sigh. The first signer is supposed to be the author.
Guenter
Hi, Guenter
Quoted 8 lines
I search the commit history and found several recent but different commits
This one is same with mine: Co-developed-by: A & SOB First & SOB Author, following the kernel doc
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=7e97cfed9929eaabc41829c395eb0d1350fccb9dBut, this one is consistent with your advise: SOB Author & Co-developed-by: A & SOB A
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.0-rc5&id=ef69aa3a986ef94f01ce8b5b619f550db54432fe
Quoted 7 lines
Yes, I know, one can always find an example for everything in the Linux kernel.
I expect the first signer to be the author, and the last signer to be the person who sent me the patch.
Guenter
Thanks for your advice, so following tag order is acceptable?
If there is no problem, I will send a new version patch.
Thanks again.
Liang
Guenter Roeck
maintainerQuoted 8 lines · Liang He
Thanks for your advice, so following tag order is acceptable?
Fixes 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")Signed-off-by Liang He <[email protected]>Co-developed-by Mengda Chen <[email protected]>Signed-off-by Mengda Chen <[email protected]>
Yes, if the author is Liang He and I get the e-mail from Mengda Chen.
Guenter