From: Krzysztof Kozlowski <krzk@kernel.org>
To: Jammy Huang <jammy_huang@aspeedtech.com>,
eajames@linux.ibm.com, mchehab@kernel.org, joel@jms.id.au,
andrew@aj.id.au, pmenzel@molgen.mpg.de
Cc: linux-media@vger.kernel.org, openbmc@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] media: aspeed: Allow to capture from SoC display (GFX)
Date: Mon, 12 Aug 2024 14:17:45 +0200 [thread overview]
Message-ID: <323f5038-f9d5-459a-a5e2-f1e4dbd4c386@kernel.org> (raw)
In-Reply-To: <20240812091656.2617664-1-jammy_huang@aspeedtech.com>
On 12/08/2024 11:16, Jammy Huang wrote:
> ASPEED BMC IC has 2 different display engines. Please find AST2600's
> datasheet to get detailed information.
>
> 1. VGA on PCIe
> 2. SoC Display (GFX)
...
>
> +/*
> + * 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;
> + struct regmap *regmap;
Drop...
> +
> + syscon_np = of_parse_phandle(np, property, 0);
This joins first line and then use scoped/cleanup to make everything
simpler.
> + if (!syscon_np)
> + return ERR_PTR(-ENODEV);
> +
> + regmap = device_node_to_regmap(syscon_np);
> + of_node_put(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");
This looks undocumented.
You will need to convert the bindings to DT Schema first.
Anyway, you miss here error checking.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-08-12 12:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 9:16 Jammy Huang
2024-08-12 12:17 ` Krzysztof Kozlowski [this message]
2024-08-13 8:07 ` Jammy Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=323f5038-f9d5-459a-a5e2-f1e4dbd4c386@kernel.org \
--to=krzk@kernel.org \
--cc=andrew@aj.id.au \
--cc=eajames@linux.ibm.com \
--cc=jammy_huang@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®