HomeFreeBSD

linuxkpi: Add device under parent, not under class

Description

linuxkpi: Add device under parent, not under class

In device_add(), the function used to add the given device under its
class. This is used to build a sysctl tree. We ended up with devices or
"pseudo" devices (like the output connectors of a GPU). For example with
an output connector:

sysctl sys.class.drm.card0-DP-1

This device should be added under its parent if it has one. With this
fix, the same output connector is now:

sysctl sys.device.drmn1.card0.card0-DP-1

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55175