[PATCH v4 2/2] media: aspeed: Allow to capture from SoC display (GFX)

Jammy Huang jammy_huang at aspeedtech.com
Fri Aug 16 12:31:43 AEST 2024


Hi Krzysztof,

On 2024/8/14 下午 02:09, Krzysztof Kozlowski wrote:
>
> On 14/08/2024 02:54, Jammy Huang wrote:
> > +/*
> > + * Get regmap without checking res, such as clk/reset, that could
> > +lead to
> > + * conflict.
> > + */
> > +static struct regmap *aspeed_regmap_lookup(struct device_node *np,
> > +const char *property) {
> > +   struct device_node *syscon_np __free(device_node) =
> of_parse_phandle(np, property, 0);
> > +   struct regmap *regmap;
>
> Drop. The point of using __free was to make this very simple.
To be simpler, it will looks like this, right.

+       struct device_node *syscon_np __free(device_node) = of_parse_phandle(np, property, 0);
+
+       if (!syscon_np)
+               return ERR_PTR(-ENODEV);
+       return device_node_to_regmap(syscon_np);
>
> > +
> > +   if (!syscon_np)
> > +           return ERR_PTR(-ENODEV);
> > +
> > +   regmap = device_node_to_regmap(syscon_np);
> > +
> > +   return regmap;
> > +}
> > +
> >  static int aspeed_video_init(struct aspeed_video *video)  {
> >     int irq;
> >     int rc;
> >     struct device *dev = video->dev;
> >
> > +   video->scu = aspeed_regmap_lookup(dev->of_node, "aspeed,scu");
> > +   video->gfx = aspeed_regmap_lookup(dev->of_node, "aspeed,gfx");
>
> Still undocumented. Respond to previous comment and confirm that you
> understood it.
Sorry for misunderstanding. I will add document,
Documentation/devicetree/bindings/arm/aspeed/aspeed,video.yaml, later.

>
>
> Best regards,
> Krzysztof

************* Email Confidentiality Notice ********************
免責聲明:
本信件(或其附件)可能包含機密資訊,並受法律保護。如 台端非指定之收件者,請以電子郵件通知本電子郵件之發送者, 並請立即刪除本電子郵件及其附件和銷毀所有複印件。謝謝您的合作!

DISCLAIMER:
This message (and any attachments) may contain legally privileged and/or other confidential information. If you have received it in error, please notify the sender by reply e-mail and immediately delete the e-mail and any attachments without copying or disclosing the contents. Thank you.


More information about the openbmc mailing list