spi: change inline functions to static inline

When compiling with optimization level 0 (-O0), the linker complains
about missing references to uart functions. This is due to compiler
treating this functions as extern, since -O0 disables function inlining,
as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653

So change the declaration to static inline.

Change-Id: I2b75e686961878f299bb951b5a420f9738594795
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2015-08-24 10:00:05 -07:00 committed by Anas Nashif
parent 03066f26d8
commit 5f353e0e94

View file

@ -106,7 +106,7 @@ struct spi_driver_api {
*
* @return DEV_OK if successful, another DEV_* code otherwise.
*/
inline int spi_configure(struct device *dev, struct spi_config *config)
static inline int spi_configure(struct device *dev, struct spi_config *config)
{
struct spi_driver_api *api = (struct spi_driver_api *)dev->driver_api;
return api->configure(dev, config);
@ -144,7 +144,7 @@ inline int spi_slave_select(struct device *dev, uint32_t slave)
*
* @return DEV_OK if successful, another DEV_* code otherwise.
*/
inline int spi_read(struct device *dev, uint8_t *buf, uint32_t len)
static inline int spi_read(struct device *dev, uint8_t *buf, uint32_t len)
{
struct spi_driver_api *api = (struct spi_driver_api *)dev->driver_api;
return api->transceive(dev, NULL, 0, buf, len);
@ -158,7 +158,7 @@ inline int spi_read(struct device *dev, uint8_t *buf, uint32_t len)
*
* @return DEV_OK if successful, another DEV_* code otherwise.
*/
inline int spi_write(struct device *dev, uint8_t *buf, uint32_t len)
static inline int spi_write(struct device *dev, uint8_t *buf, uint32_t len)
{
struct spi_driver_api *api = (struct spi_driver_api *)dev->driver_api;
return api->transceive(dev, buf, len, NULL, 0);
@ -191,7 +191,7 @@ inline int spi_transceive(struct device *dev,
*
* @return DEV_OK if successful, another DEV_* code otherwise.
*/
inline int spi_suspend(struct device *dev)
static inline int spi_suspend(struct device *dev)
{
struct spi_driver_api *api = (struct spi_driver_api *)dev->driver_api;
return api->suspend(dev);
@ -203,7 +203,7 @@ inline int spi_suspend(struct device *dev)
*
* @return DEV_OK if successful, another DEV_* code otherwise.
*/
inline int spi_resume(struct device *dev)
static inline int spi_resume(struct device *dev)
{
struct spi_driver_api *api = (struct spi_driver_api *)dev->driver_api;
return api->resume(dev);