From: Jason Gunthorpe Subject: Re: [PATCH v5 4/5] Initialize TPM and get durations and timeouts Date: Thu, 11 Feb 2016 16:56:11 -0700 Message-ID: <20160211235611.GB16304@obsidianresearch.com> References: <20160210222313.GA7047@obsidianresearch.com> <201602110038.u1B0cuE0030670@d03av05.boulder.ibm.com> <20160211070426.GB9307@intel.com> <201602111534.u1BFYvRs019573@d01av03.pok.ibm.com> <20160211181208.GA6285@obsidianresearch.com> <201602111911.u1BJB2nK017410@d01av03.pok.ibm.com> <20160211194810.GA24211@obsidianresearch.com> <201602112210.u1BMAYPe015452@d03av01.boulder.ibm.com> <20160211221822.GA16304@obsidianresearch.com> <201602112226.u1BMQZ59031657@d01av02.pok.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <201602112226.u1BMQZ59031657-prK0F/7GlgzImUpY6SP3GEEOCMrvLtNR@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Thu, Feb 11, 2016 at 05:26:24PM -0500, Stefan Berger wrote: > > What is the point of tpmm_chip_dev? > So that the usage model of the chip is the same. We get this in the > tpm-vtpm.c with tpm_alloc_chip + tpmm_chip_dev while all others can > call tpmm_chip_alloc, which combines the two. No need, just don't use devm in vtpm, that is even better. The standard devm idiom is a with and without version. > > Just have the vtpm driver do device_initialize, then tpm_alloc and > > have the release function do put_device on the chip. No need for devm > > at all > I would also like to have a tpm_chip_put (static inline in tpm.h ?) > that wraps the put_device. To me this is more intuitive than calling > put_device() as a counter-part to tpm_chip_alloc. Many in the kernel community would call this sort of wrapping obfuscation.. We don't have a put_platform_device, etc for instance. Naked put_device in an error path is fine. Jason ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140