From 681a4df7877e0973cef7bfd8014a79d384368d5c Mon Sep 17 00:00:00 2001 From: Marcus Shawcroft Date: Mon, 24 Oct 2016 10:19:33 +0100 Subject: [PATCH] th02: Limit name space pollution by using 'static' The name read16() collides with other definitions within Zephyr. We don't actually use this function here, so remove the definition. Fix various other unnecessary name exports while we are here by adding 'static'. Change-Id: I7eee8c527a62fea4e6e1bdae8a4874d8ce66596c Signed-off-by: Marcus Shawcroft --- drivers/sensor/th02/th02.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/sensor/th02/th02.c b/drivers/sensor/th02/th02.c index e894e48b9ff..1684a2e7049 100644 --- a/drivers/sensor/th02/th02.c +++ b/drivers/sensor/th02/th02.c @@ -24,17 +24,7 @@ #include "th02.h" -uint16_t read16(struct device *dev, uint8_t d) -{ - uint8_t buf[2]; - - if (i2c_burst_read(dev, TH02_I2C_DEV_ID, d, (uint8_t *)buf, 2) < 0) { - SYS_LOG_ERR("Error reading register."); - } - return (buf[0] << 8 | buf[1]); -} - -uint8_t read8(struct device *dev, uint8_t d) +static uint8_t read8(struct device *dev, uint8_t d) { uint8_t buf; @@ -44,7 +34,7 @@ uint8_t read8(struct device *dev, uint8_t d) return buf; } -int is_ready(struct device *dev) +static int is_ready(struct device *dev) { uint8_t status; @@ -61,7 +51,7 @@ int is_ready(struct device *dev) } } -uint16_t get_humi(struct device *dev) +static uint16_t get_humi(struct device *dev) { uint16_t humidity = 0; @@ -139,7 +129,7 @@ static struct sensor_driver_api th02_driver_api = { .channel_get = th02_channel_get, }; -int th02_init(struct device *dev) +static int th02_init(struct device *dev) { struct th02_data *drv_data = dev->driver_data; @@ -155,7 +145,7 @@ int th02_init(struct device *dev) return 0; } -struct th02_data th02_driver; +static struct th02_data th02_driver; DEVICE_INIT(th02, CONFIG_TH02_NAME, th02_init, &th02_driver, NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);