Message ID | 20201208122855.254819-17-tomi.valkeinen@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Convert DSI code to use drm_mipi_dsi and drm_panel (second half) | expand |
Hi Tomi, Thank you for the patch. On Tue, Dec 08, 2020 at 02:28:42PM +0200, Tomi Valkeinen wrote: > We have a useless 'if' in the dsicm_bl_update_status(), a left over from > the conversion to DRM model. Drop the if. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> > Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > drivers/gpu/drm/panel/panel-dsi-cm.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c > index 556f9a2c5c0c..fa564aad7f25 100644 > --- a/drivers/gpu/drm/panel/panel-dsi-cm.c > +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c > @@ -202,11 +202,9 @@ static int dsicm_bl_update_status(struct backlight_device *dev) > > mutex_lock(&ddata->lock); > > - if (ddata->enabled) { > - if (!r) > - r = dsicm_dcs_write_1( > - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); > - } > + if (ddata->enabled) > + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, > + level); > > mutex_unlock(&ddata->lock); >
Hi, On Tue, Dec 08, 2020 at 02:28:42PM +0200, Tomi Valkeinen wrote: > We have a useless 'if' in the dsicm_bl_update_status(), a left over from > the conversion to DRM model. Drop the if. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> > Reviewed-by: Sam Ravnborg <sam@ravnborg.org> > --- Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> -- Sebastian > drivers/gpu/drm/panel/panel-dsi-cm.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c > index 556f9a2c5c0c..fa564aad7f25 100644 > --- a/drivers/gpu/drm/panel/panel-dsi-cm.c > +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c > @@ -202,11 +202,9 @@ static int dsicm_bl_update_status(struct backlight_device *dev) > > mutex_lock(&ddata->lock); > > - if (ddata->enabled) { > - if (!r) > - r = dsicm_dcs_write_1( > - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); > - } > + if (ddata->enabled) > + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, > + level); > > mutex_unlock(&ddata->lock); > > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki >
diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c index 556f9a2c5c0c..fa564aad7f25 100644 --- a/drivers/gpu/drm/panel/panel-dsi-cm.c +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c @@ -202,11 +202,9 @@ static int dsicm_bl_update_status(struct backlight_device *dev) mutex_lock(&ddata->lock); - if (ddata->enabled) { - if (!r) - r = dsicm_dcs_write_1( - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); - } + if (ddata->enabled) + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, + level); mutex_unlock(&ddata->lock);