[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmBLJf8JQkfSQGvA@kroah.com>
Date: Wed, 20 Apr 2022 20:04:21 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: "Williams, Dan J" <dan.j.williams@...el.com>,
Hans de Goede <hdegoede@...hat.com>,
"markgross@...nel.org" <markgross@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Jonathan Corbet <corbet@....net>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Joseph, Jithu" <jithu.joseph@...el.com>,
"Raj, Ashok" <ashok.raj@...el.com>,
Steven Rostedt <rostedt@...dmis.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
"platform-driver-x86@...r.kernel.org"
<platform-driver-x86@...r.kernel.org>,
"patches@...ts.linux.dev" <patches@...ts.linux.dev>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>
Subject: Re: [PATCH v3 03/11] platform/x86/intel/ifs: Create device for Intel
IFS (In Field Scan)
On Wed, Apr 20, 2022 at 05:57:04PM +0000, Luck, Tony wrote:
> >> ifs_class = class_create(THIS_MODULE, "intel_ifs");
> >
> > Why do you need a class? Why not just use a misc device? Saves you
> > loads of boilerplate code that is sometimes tricky to get correct.
>
> It didn't feel like a "ton" of boiler plate. Just class_create()/class_destroy()
> for the class itself. And
>
> class_for_each_device(ifs_class, NULL, NULL, ifs_device_unregister);
>
> to clean up devices on exit (or error cleanup in init()).
>
>
> I thought I needed a class to make a directory for my per-test directories to live in:
>
> $ ls -l /sys/devices/virtual/intel_ifs
> total 0
> drwxr-xr-x 3 root root 0 Apr 20 13:36 ifs0
> drwxr-xr-x 3 root root 0 Apr 20 13:36 ifs1
>
> Can I do that with a misc device?
>
> Or is it ok for them all to sit at the top level of /sys/devices/virtual?
How many do you have?
And why is a directory needed for just one tiny driver type?
thanks,
greg k-h
Powered by blists - more mailing lists