drivers: display: ssd1306: Cleanup

- Removed unused variables from the data struct
- Set all members of capability struct in `ssd1306_get_capabilities`
  instead of zeroing it. This has the same effect but saves some bytes.
- Removed empty log

Signed-off-by: Greter Raffael <rgreter@baumer.com>
This commit is contained in:
Greter Raffael 2024-02-02 13:33:19 +00:00 committed by Alberto Escolar
parent cbec4753e1
commit 1109027c55

View file

@ -60,8 +60,6 @@ struct ssd1306_config {
};
struct ssd1306_data {
uint8_t contrast;
uint8_t scan_mode;
enum display_pixel_format pf;
};
@ -335,12 +333,12 @@ static void ssd1306_get_capabilities(const struct device *dev,
const struct ssd1306_config *config = dev->config;
struct ssd1306_data *data = dev->data;
memset(caps, 0, sizeof(struct display_capabilities));
caps->x_resolution = config->width;
caps->y_resolution = config->height;
caps->supported_pixel_formats = PIXEL_FORMAT_MONO10 | PIXEL_FORMAT_MONO01;
caps->current_pixel_format = data->pf;
caps->screen_info = SCREEN_INFO_MONO_VTILED;
caps->current_orientation = DISPLAY_ORIENTATION_NORMAL;
}
static int ssd1306_set_pixel_format(const struct device *dev,
@ -432,8 +430,6 @@ static int ssd1306_init(const struct device *dev)
{
const struct ssd1306_config *config = dev->config;
LOG_DBG("");
k_sleep(K_TIMEOUT_ABS_MS(config->ready_time_ms));
if (!ssd1306_bus_ready(dev)) {