[Bug 262690] "driver bug: Unable to set devclass" for atrtc

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 28 Nov 2024 18:33:20 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262690

--- Comment #5 from John F. Carr <jfc@mit.edu> ---
If I boot verbose I see

  atrtc: atrtc-1 already exists; skipping it

This message comes from devclass_alloc_unit.

  printf("%s: %s%d already exists; skipping it\n", dc->name, dc->name, *unitp);

So *unitp == -1.  Variable

  int unit = *unitp;

was initialized to -1, or DEVICE_UNIT_ANY.  So this BUS_HINT_DEVICE_UNIT call
must have happened.

        /* Ask the parent bus if it wants to wire this device. */
        if (unit == DEVICE_UNIT_ANY)
                BUS_HINT_DEVICE_UNIT(device_get_parent(dev), dev, dc->name,
                    &unit);

The printf is guarded by

        if (unit != DEVICE_UNIT_ANY)

so BUS_HINT_DEVICE_UNIT must have assigned a unit number.  This macro invokes
a bus_hint_device_unit method.  There are only three of these, one each for
isa, pci, and acpica.

-- 
You are receiving this mail because:
You are the assignee for the bug.