Skip to content

Commit 65b4e59

Browse files
thugheskartben
authored andcommitted
drivers: gpio: pca95xx: Remove unused functions
Building with clang warns: drivers/gpio/gpio_pca95xx.c:256:19: error: unused function 'update_input_reg' [-Werror,-Wunused-function] static inline int update_input_reg(const struct device *dev, uint8_t pin, ^ drivers/gpio/gpio_pca95xx.c:120:12: error: unused function 'read_port_reg' [-Werror,-Wunused-function] static int read_port_reg(const struct device *dev, uint8_t reg, ^ uint8_t pin, Signed-off-by: Tom Hughes <[email protected]>
1 parent 145b1b9 commit 65b4e59

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

drivers/gpio/gpio_pca95xx.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -117,38 +117,6 @@ struct gpio_pca95xx_drv_data {
117117
#endif
118118
};
119119

120-
static int read_port_reg(const struct device *dev, uint8_t reg, uint8_t pin,
121-
uint16_t *cache, uint16_t *buf)
122-
{
123-
const struct gpio_pca95xx_config * const config = dev->config;
124-
uint8_t b_buf;
125-
int ret;
126-
127-
if (pin >= 8) {
128-
reg++;
129-
}
130-
131-
ret = i2c_reg_read_byte_dt(&config->bus, reg, &b_buf);
132-
if (ret != 0) {
133-
LOG_ERR("PCA95XX[0x%X]: error reading register 0x%X (%d)",
134-
config->bus.addr, reg, ret);
135-
return ret;
136-
}
137-
138-
if (pin < 8) {
139-
((uint8_t *)cache)[LOW_BYTE_LE16_IDX] = b_buf;
140-
} else {
141-
((uint8_t *)cache)[HIGH_BYTE_LE16_IDX] = b_buf;
142-
}
143-
144-
*buf = *cache;
145-
146-
LOG_DBG("PCA95XX[0x%X]: Read: REG[0x%X] = 0x%X",
147-
config->bus.addr, reg, b_buf);
148-
149-
return 0;
150-
}
151-
152120
/**
153121
* @brief Read both port 0 and port 1 registers of certain register function.
154122
*
@@ -253,16 +221,6 @@ static int write_port_regs(const struct device *dev, uint8_t reg,
253221
return ret;
254222
}
255223

256-
static inline int update_input_reg(const struct device *dev, uint8_t pin,
257-
uint16_t *buf)
258-
{
259-
struct gpio_pca95xx_drv_data * const drv_data =
260-
(struct gpio_pca95xx_drv_data * const)dev->data;
261-
262-
return read_port_reg(dev, REG_INPUT_PORT0, pin,
263-
&drv_data->reg_cache.input, buf);
264-
}
265-
266224
static inline int update_input_regs(const struct device *dev, uint16_t *buf)
267225
{
268226
struct gpio_pca95xx_drv_data * const drv_data =

0 commit comments

Comments
 (0)