include: mdio.h: Make bus functions optional
Make bus_enable and bus_disable optional for drivers to implement by checking if it is NULL in the api struct. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
parent
5033399322
commit
3ef9880457
|
@ -73,7 +73,9 @@ static inline void z_impl_mdio_bus_enable(const struct device *dev)
|
|||
const struct mdio_driver_api *api =
|
||||
(const struct mdio_driver_api *)dev->api;
|
||||
|
||||
if (api->bus_enable != NULL) {
|
||||
api->bus_enable(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,7 +91,9 @@ static inline void z_impl_mdio_bus_disable(const struct device *dev)
|
|||
const struct mdio_driver_api *api =
|
||||
(const struct mdio_driver_api *)dev->api;
|
||||
|
||||
if (api->bus_disable != NULL) {
|
||||
api->bus_disable(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue