On Fri, Mar 06, 2026 at 06:34:43PM +0100, Bartosz Golaszewski wrote:
On Fri, Mar 6, 2026 at 4:39 PM Johan Hovold [off-list ref] wrote:
quoted
You have posted changes that will prevent driver from accessing the
struct device of core i2c structures. This is unexpected, non-idiomatic
and subsystem specific and therefore a bad idea.
That's not true, the changes provide a helper to that end.
That was supposed to say "prevent drivers from accessing the struct
device *directly*".
quoted
Again, this is a core feature of the driver model. You can't just ignore
it and come up with random ways to work around just because you disagree
with design decisions that were made 25 years ago.
It absolutely *can* be done differently. There's nothing that imposes
a certain API design on susbsystems. If you design the subsystem code
well, provider drivers don't need more than one reference (taken in
probe(), released in remove(), for instance via the
register()/unregister() pair) so the counting can be hidden within the
subsystems that control them.
Yes, there is nothing preventing you from diverting from the idiomatic
way of doing things. But my point is that that's not a good idea.
Johan