lkml.org 
[lkml]   [2018]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 1/3] drm/panel: refactor INNOLUX P079ZCA panel driver
Date
Am Mittwoch, 14. März 2018, 13:02:13 CEST schrieb Emil Velikov:
> Hi Lin,
>
> On 14 March 2018 at 09:12, Lin Huang <hl@rock-chips.com> wrote:
> > From: huang lin <hl@rock-chips.com>
> >
> > Refactor Innolux P079ZCA panel driver, let it support
> > multi panel.
> >
> > Change-Id: If89be5e56dba8cb498e2d50c1bbeb0e8016123a2
> > Signed-off-by: Lin Huang <hl@rock-chips.com>

[...]

> > @@ -207,19 +248,28 @@ static const struct drm_panel_funcs innolux_panel_funcs = {
>
> >
> > - innolux->supply = devm_regulator_get(dev, "power");
> > - if (IS_ERR(innolux->supply))
> > - return PTR_ERR(innolux->supply);
> > + innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
> > + if (!innolux)
> > + return -ENOMEM;
> > +
> > + innolux->desc = desc;
> > + innolux->vddi = devm_regulator_get(dev, "power");
> > + innolux->avdd = devm_regulator_get(dev, "avdd");
> > + innolux->avee = devm_regulator_get(dev, "avee");
> >
> AFAICT devm_regulator_get returns a pointer which is unsuitable to be
> passed into regulator_{enable,disable}.
> Hence, the IS_ERR check should stay. If any of the regulators are
> optional, you want to call regulator_{enable,disable} only as
> applicable.

using the regulator_bulk APIs should help to make this far easier,
as you can just define the per-panel supplies in in the panel_desc
and then get + enable the correct ones per bound panel.


\
 
 \ /
  Last update: 2018-06-14 14:49    [W:0.177 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site