On Mon, Apr 11, 2016 at 03:33:10PM -0400, Stefan Berger wrote:
>    If the intent is to get rid of the priv field, I am not sure whether we
>    can solve the problem this way.

We are not 'getting rid' of priv, the desire is to replace chip->priv with
dev_get_drvdata(&chip->dev), which is more consistent with the core driver
model.

> You may remember that the vtpm proxy driver only registers the chip
> once startup and retrieval of durations and timeouts successfully

Doesn't matter, just dev_set_drvdata right after the chip is
allocated, just like vtpm does already for chip->priv.

> If this patch is some form of cleanup, that may be a different
> story.

The issue with swapping in drvdata is that your patch series causes
the sysfs code to conflict with it here:

>    > @@ -36,7 +36,7 @@ static ssize_t pubek_show(struct device *dev,
>    > struct device_attribute *attr,
>    >     int i, rc;
>    >     char *str = buf;
>    >
>    > -   struct tpm_chip *chip = dev_get_drvdata(dev);
>    > +   struct tpm_chip *chip = to_tpm_chip(dev);

This broad outline is a different way for you to address the NULL
parent & sysfs issue by using optional symlinks instead. By doing this
it is no longer necessary to abuse drvdata in the core code.

ie your sysfs patch would not longer call drv_set_drvdata.

Jason

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to