lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem
On Mon, Apr 20, 2015 at 09:56:48AM -0600, Jason Gunthorpe wrote:
> On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote:
> > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote:
> > > I still suspect the expected way to write a new mid layer is to create
> > > your own struct device and not rely on misc_device,
> >
> > Yes, that is the way. You can not use misc_device for anything other
> > than creating the char node that your driver can use through the fileops
> > you pass to it.
> >
> > Do not use a misc_device to create sysfs files for, or anything else, it
> > will be wrong and racy, as you have pointed out.
>
> Thanks!
>
> Can you quickly comment on when a misc device should be used compared to
> alloc_chrdev_region & cdev_add ?

If you need more than one character device node, don't use a misc
device. If you only need one, and nothing "special" or "fancy", and
don't want to put sysfs attribute files on your device, then use a misc
device.

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-04-20 18:41    [W:0.070 / U:3.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site