Thread (37 messages) 37 messages, 5 authors, 2026-03-17

Re: [PATCH v2 00/13] i2c: add and start using i2c_adapter-specific printk helpers

flat view

From: Johan Hovold <johan@kernel.org>
Date: 2026-03-09 10:31:16
Also in: linux-arm-kernel, linux-i2c, linux-media, linux-sunxi, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help