From: Fabio Estevam <festevam@gmail.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Sascha Hauer" <kernel@pengutronix.de>,
"NXP Linux Team" <linux-imx@nxp.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Guido Günther" <agx@sigxcpu.org>, "Marek Vasut" <marex@denx.de>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Ping Bai" <ping.bai@nxp.com>,
"Schrempf Frieder" <frieder.schrempf@kontron.de>,
"Adam Ford" <aford173@gmail.com>, "Abel Vesa" <abel.vesa@nxp.com>,
"Peng Fan" <peng.fan@nxp.com>
Subject: Re: [PATCH V2 4/4] soc: imx: Add blk-ctl driver for i.MX8MM
Date: Tue, 4 May 2021 08:13:37 -0300 [thread overview]
Message-ID: <CAOMZO5A4JOP0zST75bO9Ww7pxJjJSYHE9HmWCJb7DjYYd-Y80Q@mail.gmail.com> (raw)
In-Reply-To: <20210430052746.10815-5-peng.fan@oss.nxp.com>
Hi Peng,
On Fri, Apr 30, 2021 at 1:56 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> +static int imx8mm_blk_ctl_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + const struct imx_blk_ctl_dev_data *dev_data = of_device_get_match_data(dev);
> + struct regmap *regmap;
> + struct resource *res;
> + struct imx_blk_ctl *ctl;
> + void __iomem *base;
> +
> + ctl = devm_kzalloc(dev, sizeof(*ctl), GFP_KERNEL);
> + if (!ctl)
> + return -ENOMEM;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(base))
> + return PTR_ERR(base);
> +
> + regmap = devm_regmap_init_mmio(dev, base, &dev_data->config);
> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);
> +
> + ctl->regmap = regmap;
> + ctl->dev = dev;
> + atomic_set(&ctl->power_count, 0);
> +
> + ctl->num_clks = devm_clk_bulk_get_all(dev, &ctl->clks);
> + if (ctl->num_clks < 0)
> + return ctl->num_clks;
> +
> + dev_set_drvdata(dev, ctl);
> + ctl->dev_data = of_device_get_match_data(dev);
No need to call of_device_get_match_data() twice. You could do:
ctl->dev_data = dev_data;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-04 11:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 5:27 [PATCH V2 0/4] soc: imx: add i.MX BLK-CTL support Peng Fan (OSS)
2021-04-30 5:27 ` [PATCH V2 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Peng Fan (OSS)
2021-04-30 5:27 ` [PATCH V2 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Peng Fan (OSS)
2021-05-05 23:08 ` Rob Herring
2021-05-06 0:50 ` Peng Fan (OSS)
2021-04-30 5:27 ` [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver Peng Fan (OSS)
2021-05-04 9:47 ` Lucas Stach
2021-05-04 10:30 ` Peng Fan (OSS)
2021-05-04 10:16 ` Frieder Schrempf
2021-05-04 11:22 ` Peng Fan (OSS)
2021-05-06 7:55 ` Frieder Schrempf
2021-04-30 5:27 ` [PATCH V2 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Peng Fan (OSS)
2021-05-04 10:25 ` Frieder Schrempf
2021-05-04 11:13 ` Fabio Estevam [this message]
2021-05-04 11:22 ` Peng Fan
2021-04-30 6:19 ` [PATCH V2 0/4] soc: imx: add i.MX BLK-CTL support Peng Fan
2021-05-03 14:57 ` Frieder Schrempf
2021-05-04 8:55 ` Frieder Schrempf
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=CAOMZO5A4JOP0zST75bO9Ww7pxJjJSYHE9HmWCJb7DjYYd-Y80Q@mail.gmail.com \
--to=festevam@gmail.com \
--cc=abel.vesa@nxp.com \
--cc=aford173@gmail.com \
--cc=agx@sigxcpu.org \
--cc=andrew.smirnov@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=frieder.schrempf@kontron.de \
--cc=kernel@pengutronix.de \
--cc=krzk@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=p.zabel@pengutronix.de \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=ping.bai@nxp.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).