On Sun, Oct 01, 2023 at 11:15:12PM +0200, Richard wrote:
> > > I've seen struct class defines **class_groups, but (contrary to struct
> > > kobj_type) not the corresponding struct sysfs_ops, why? Where is it then?
> >
> > groups are used to define attributes (i.e. sysfs files). sysfs_ops is
> >
Is it possible that one device belongs to several classes?
No.
Oops, well yes. Depends on what you are thinking is a "device" here.
In the kernel, yes, a 'struct device' on a bus can then register itself
with multiple subsystems that handle different classes, and then
individual
Close.
"struct class" represents how userspace interacts with a device (tty /
input / block / etc.)
"struct kobj_type" is needed to describe what "type" of struct kobject a
specific kobject is. It defines a number of operations that handle the
lifespan of the kobject.
Oki
My digging
On Sun, Oct 01, 2023 at 11:50:46AM +0200, Greg KH wrote:
> On Sat, Sep 30, 2023 at 08:17:26PM +0200, Richard wrote:
> > Hi,
> >
> > I appreciate your answer, thank you for your time.
> >
> > >
> > > Look closer. Tell me what "struct class" is for vs. what "struct
> > > kobj_type" is for and
On Sat, Sep 30, 2023 at 08:17:26PM +0200, Richard wrote:
> Hi,
>
> I appreciate your answer, thank you for your time.
>
> >
> > Look closer. Tell me what "struct class" is for vs. what "struct
> > kobj_type" is for and see if they both could be used for the same thing?
>
> I've looked at the
Hi,
I appreciate your answer, thank you for your time.
Look closer. Tell me what "struct class" is for vs. what "struct
kobj_type" is for and see if they both could be used for the same thing?
I've looked at the definitions in include/linux and thought a bit about
the semantics.
struct
On Sat, Sep 30, 2023 at 02:12:41AM +0200, Richard wrote:
> Hi all,
>
> Why do we have ktypes (struct kobj_type) AND device classes (struct class)?
Because they are two totally different things.
> Don't they serve the same purpose (more or less) and it would be simpler,
> clearer and more KISS
Hi all,
Why do we have ktypes (struct kobj_type) AND device classes (struct class)?
Don't they serve the same purpose (more or less) and it would be
simpler, clearer and more KISS to only have one? Is this a historically
grown thing or by design?
Thanks,
-- Richard