drivers/clock_control: Make references to driver_api const
Change-Id: I059fd2df62059a782b7ac5aa6e68e2cd948a2bc1 Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
This commit is contained in:
parent
df35c244c4
commit
4b93e14b64
1 changed files with 3 additions and 7 deletions
|
@ -61,9 +61,8 @@ struct clock_control_driver_api {
|
||||||
static inline int clock_control_on(struct device *dev,
|
static inline int clock_control_on(struct device *dev,
|
||||||
clock_control_subsys_t sys)
|
clock_control_subsys_t sys)
|
||||||
{
|
{
|
||||||
struct clock_control_driver_api *api;
|
const struct clock_control_driver_api *api = dev->driver_api;
|
||||||
|
|
||||||
api = (struct clock_control_driver_api *)dev->driver_api;
|
|
||||||
return api->on(dev, sys);
|
return api->on(dev, sys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +75,8 @@ static inline int clock_control_on(struct device *dev,
|
||||||
static inline int clock_control_off(struct device *dev,
|
static inline int clock_control_off(struct device *dev,
|
||||||
clock_control_subsys_t sys)
|
clock_control_subsys_t sys)
|
||||||
{
|
{
|
||||||
struct clock_control_driver_api *api;
|
const struct clock_control_driver_api *api = dev->driver_api;
|
||||||
|
|
||||||
api = (struct clock_control_driver_api *)dev->driver_api;
|
|
||||||
return api->off(dev, sys);
|
return api->off(dev, sys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,9 +91,7 @@ static inline int clock_control_get_rate(struct device *dev,
|
||||||
clock_control_subsys_t sys,
|
clock_control_subsys_t sys,
|
||||||
uint32_t *rate)
|
uint32_t *rate)
|
||||||
{
|
{
|
||||||
struct clock_control_driver_api *api;
|
const struct clock_control_driver_api *api = dev->driver_api;
|
||||||
|
|
||||||
api = (struct clock_control_driver_api *)dev->driver_api;
|
|
||||||
|
|
||||||
__ASSERT(api->get_rate, "%s not implemented for device %s",
|
__ASSERT(api->get_rate, "%s not implemented for device %s",
|
||||||
__func__, dev->config->name);
|
__func__, dev->config->name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue