You can look at e.g. the lis2dh12 driver, it supports both I2C and SPI transport.
You will find that the register interface is the same for both, so it’s enough to implement only the read and write functions for both I2C and SPI with a common interface.
This is then selected via the pseudo-modules lis2dh12_i2c and lis2dh12_spi respectively.
If you only have one version of the device at hand, you of course don’t have to implement the other transport, but it would be good to future proof the code in that matter that the bus access is well capsuled so adding the other transport is easy in the future.