greybus: spilib: make spilib independent of gbphy
spilib is used by multiple users currently (spi.c and fw-core.c) but
commit
aa52b62a0556 broke that hierarchy and introduced gbphy dependent
code in spilib.
This may have unreliable consequences as we are doing following
operation unconditionally now:
gbphy_dev = to_gbphy_dev(spi->parent);
gbphy_runtime_get_sync(gbphy_dev);
which may not go well when the parent is of type &bundle->dev
(fw-core.c).
This patch introduces spilib_ops and lets the users of the core register
them. This shall have no functional change for the spi.c usecase and
shall fix the unreliable results for the fw-core.c usecase.
Tested by writing to mtd0 dev and verifying (with print messages) that
the below routines are getting called for a gpbridge-test module.
Fixes:
aa52b62a0556 ("spi: Add runtime_pm support")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>