Re: [PATCH v4 2/2] drm/panel: Add support for Raydium RM67191 panel driver

From: Fabio Estevam
Date: Tue Jun 25 2019 - 10:06:16 EST


Hi Robert,

On Tue, Jun 25, 2019 at 4:28 AM Robert Chiras <robert.chiras@xxxxxxx> wrote:

> +static int rad_bl_get_brightness(struct backlight_device *bl)
> +{
> + struct mipi_dsi_device *dsi = bl_get_data(bl);
> + struct rad_panel *rad = mipi_dsi_get_drvdata(dsi);
> + struct device *dev = &dsi->dev;
> + u16 brightness;
> + int ret;
> +
> + if (!rad->prepared)
> + return 0;
> +
> + DRM_DEV_DEBUG_DRIVER(dev, "\n");

Please remove this debug line.

> + if (!rad->prepared)
> + return 0;
> +
> + DRM_DEV_DEBUG_DRIVER(dev, "New brightness: %d\n", bl->props.brightness);

Please remove it.

> + ret = of_property_read_u32(np, "dsi-lanes", &dsi->lanes);
> + if (ret) {
> + dev_err(dev, "Failed to get dsi-lanes property (%d)\n", ret);
> + return ret;
> + }
> +
> + panel->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);

Even it is optional, you still need to check for error and propagate
it in the case of error.

Otherwise defer probe will not work.

> + ret = drm_panel_add(&panel->panel);
> + if (ret)
> + return ret;
> +
> +

One blank line is enough.