Re: [PATCH v9 2/2] drm/tiny: Add driver for Sharp Memory LCD

Uwe Kleine-König
2024-10-07T07:40:59Z

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

Helo Alex,

On Sun, Oct 06, 2024 at 09:30:06PM -0400, Alex Lanzano wrote:
> +static int sharp_memory_init_pwm_vcom_signal(struct sharp_memory_device *smd)
> +{
> + struct pwm_state pwm_state;
> + struct device *dev = &smd->spi->dev;
> +
> + smd->pwm_vcom_signal = devm_pwm_get(dev, NULL);
> + if (IS_ERR(smd->pwm_vcom_signal))
> + return dev_err_probe(dev, -EINVAL, "Could not get pwm device\n");

s/-EINVAL/PTR_ERR(smd->pwm_vcom_signal)/

> + pwm_init_state(smd->pwm_vcom_signal, &pwm_state);
> + pwm_set_relative_duty_cycle(&pwm_state, 1, 10);
> + pwm_state.enabled = true;
> + pwm_apply_might_sleep(smd->pwm_vcom_signal, &pwm_state);

Error checking for pwm_apply_might_sleep() please.

> + return 0;
> +}
> [...]
> + } else if (!strcmp("pwm", vcom_mode_str)) {
> + smd->vcom_mode = SHARP_MEMORY_PWM_VCOM;
> + ret = sharp_memory_init_pwm_vcom_signal(smd);
> + if (ret)
> + return dev_err_probe(dev, ret,
> + "Failed to initialize external COM signal\n");

sharp_memory_init_pwm_vcom_signal() already emits an error message, so you
have two here. One should be enough.

> + } else {
> + return dev_err_probe(dev, -EINVAL, "Invalid value set for vcom-mode\n");
> + }
> [...]

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]