On Tue, Aug 30, 2016 at 12:50:17AM -0400, Nayna Jain wrote: > Using device of_node property is better way to refer to device node > rather than of_find_node_by_name(). > > Additionally, this patch replaces all currently used pr_err() with > recommended dev_dbg(). > > Suggested-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> > Signed-off-by: Nayna Jain <na...@linux.vnet.ibm.com> > drivers/char/tpm/tpm-chip.c | 2 ++ > drivers/char/tpm/tpm_of.c | 20 ++++++++++---------- > 2 files changed, 12 insertions(+), 10 deletions(-) > > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c > index 307130e..a040080 100644 > +++ b/drivers/char/tpm/tpm-chip.c > @@ -171,6 +171,8 @@ struct tpm_chip *tpm_chip_alloc(struct device *dev, > chip->dev.release = tpm_dev_release; > chip->dev.parent = dev; > chip->dev.groups = chip->groups; > + if (dev->of_node) > + chip->dev.of_node = chip->dev.parent->of_node;
No, that could cause all manner of problems. > + if (chip->dev.of_node) > + np = chip->dev.of_node; Just use chip->dev.parent->of_node here Jason ------------------------------------------------------------------------------ _______________________________________________ tpmdd-devel mailing list tpmdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tpmdd-devel