From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Jonathan Bakker <xc-racer2@live.ca>,
Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Kyungmin Park" <kyungmin.park@samsung.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
"Tomasz Figa" <tomasz.figa@gmail.com>,
"Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com>
Subject: Re: [PATCH 4/5] mtd: onenand: samsung: Make sure that bus clock is enabled
Date: Sun, 24 Apr 2022 13:06:55 +0200 [thread overview]
Message-ID: <32507f1d-b650-e2c9-2f04-1ac63c6774ec@linaro.org> (raw)
In-Reply-To: <CY4PR04MB056777077970A6935BC6349BCBF69@CY4PR04MB0567.namprd04.prod.outlook.com>
On 23/04/2022 05:46, Jonathan Bakker wrote:
> From: Tomasz Figa <tomasz.figa@gmail.com>
>
> This patch adds basic handling of controller bus clock to make sure that
> in device probe it is enabled and device can operate correctly. The
> clock is optional and driver behavior is identical as before this patch
> if not provided.
>
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
> ---
> drivers/mtd/nand/onenand/onenand_samsung.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c
> index a3ef4add865a..62014f8d27b6 100644
> --- a/drivers/mtd/nand/onenand/onenand_samsung.c
> +++ b/drivers/mtd/nand/onenand/onenand_samsung.c
> @@ -11,6 +11,7 @@
> * S5PC110: use DMA
> */
>
> +#include <linux/clk.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/sched.h>
> @@ -122,6 +123,7 @@ enum soc_type {
> struct s3c_onenand {
> struct mtd_info *mtd;
> struct platform_device *pdev;
> + struct clk *clk_bus;
> enum soc_type type;
> void __iomem *ctrl_base;
> void __iomem *chip_base;
> @@ -914,6 +916,10 @@ static int s3c_onenand_probe(struct platform_device *pdev)
> }
> }
>
> + onenand->clk_bus = devm_clk_get(&pdev->dev, "bus");
If it is optional, use optional clk API.
> + if (!IS_ERR(onenand->clk_bus))
> + clk_prepare_enable(onenand->clk_bus);
> +
> err = onenand_scan(mtd, 1);
> if (err)
> return err;
Error paths not updated.
Also what about other clocks?
I propose you should take over the authorship of the patch because it
will be more changes.
> @@ -945,6 +951,8 @@ static int s3c_onenand_remove(struct platform_device *pdev)
> struct mtd_info *mtd = platform_get_drvdata(pdev);
>
> onenand_release(mtd);
> + if (!IS_ERR(onenand->clk_bus))
> + clk_disable_unprepare(onenand->clk_bus);
>
> return 0;
> }
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-04-24 11:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220423034524.366612-1-xc-racer2@live.ca>
2022-04-23 3:46 ` [PATCH 2/5] mtd: onenand: samsung: Set name field of mtd_info struct Jonathan Bakker
[not found] ` <20220423034622.366696-1-xc-racer2@live.ca>
2022-04-23 3:46 ` [PATCH 3/5] mtd: onenand: samsung: Unify resource order for controller variants Jonathan Bakker
2022-04-24 11:05 ` Krzysztof Kozlowski
2022-04-23 3:46 ` [PATCH 4/5] mtd: onenand: samsung: Make sure that bus clock is enabled Jonathan Bakker
2022-04-24 11:06 ` Krzysztof Kozlowski [this message]
2022-04-23 3:46 ` [PATCH 5/5] mtd: onenand: samsung: Add device tree support Jonathan Bakker
2022-04-24 11:12 ` Krzysztof Kozlowski
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=32507f1d-b650-e2c9-2f04-1ac63c6774ec@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=pawel.mikolaj.chmiel@gmail.com \
--cc=richard@nod.at \
--cc=tomasz.figa@gmail.com \
--cc=vigneshr@ti.com \
--cc=xc-racer2@live.ca \
/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®