On Thu, May 27, 2021 at 09:30:38AM +0200, Geert Uytterhoeven wrote:
It adds a dummy object, which needs to be cleaned up. Basically you
are trading a simple NULL pointer check for a zero clock rate check
deeper inside the driver, with the additional burden of needing to
take care of the dummy clock's life cycle.
Note that most clk_*() calls happily operate on a NULL pointer, and
just return success. This includes clk_get_rate(), which returns
a zero rate.
Mark might have a different view, though, due to his experience with
dummy regulators?
Not particularly TBH. The regulator API doesn't accept NULL
pointers due to constant issues with people just ignoring errors
especially around trying to decide that devices don't need power,
it'd just make all that worse.