lkml.org 
[lkml]   [2016]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h
On Sat, Sep 03, 2016 at 09:26:05AM +0300, Jarkko Sakkinen wrote:
> >
> > OK, how would one get the chip instance?

Most subsystems have a get function that returns a kref'd pointer. For
TPM all we really need today is a 'get_default_tpm_for_ns' kind of
function.

> This still doesn't explain why moving the structures inside the driver
> would be wrong. Even if outside callers would use a pointer the
> structure could be opaque.

For instance, if we did a get function then the 'put' function would
be an inline around dev_put and that needs to see inside the chip.

This is a well trodden pattern in the kernel, there is no reason to do
something different for tpm.

Jason

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:1.512 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site