The documentation for device_class_set_parent_realize() suggests that
the parent realize function pointer is "usually in the instance
structure". This is definitely wrong, because the function pointer
is a class thing, and should live in a class struct, not an instance
struct. Update the documentation to correct this, instead
recommending that it should be placed in the class struct for the
child class.
At time of writing, of the 75 or so uses of this function, about 50
put the parent_realize pointer in the child class struct, and about
25 in the parent class struct. We recommend the former both because
it is the more common choice, and also because it makes more logical
sense: it's the child that knows (a) that it exists at all and that
(b) it wants to have a realize method that will mean it needs to
chain back to the parent, and we shouldn't need to edit the parent's
class struct because we want to add a child class that chains to its
realize method.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Message-id: 20261015163352.1751191-1-peter.maydell@linaro.org