Re: [PATCH net-next 3/3] net: phy: bcm54140: add hwmon support
From: Andrew Lunn
Date: Sun Apr 19 2020 - 17:55:57 EST
> But what does that have to do with the shared structure? I don't think
> you have to "bundle" the shared structure with the "access the global
> registers" method.
We don't need to. But it would be a good way to clean up code which
locks the mdio bus, does a register access on some other device, and
then unlocks the bus.
As a general rule of thumb, it is better to have the core do the
locking, rather than the driver. Driver writers don't always think
about locking, so it is better to give driver writers safe APIs to
use.
Andrew