Message ID | 1594717754-25428-1-git-send-email-zhangqing@loongson.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | spi: Use clk_prepare_enable and clk_disable_unprepare | expand |
On Tue, Jul 14, 2020 at 05:09:14PM +0800, Qing Zhang wrote: > Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare > calls as required by common clock framework. > > Signed-off-by: Qing Zhang <zhangqing@loongson.cn> > --- > drivers/spi/spi-coldfire-qspi.c | 4 ++-- Are you sure that ColdFire uses the common clock framework? > drivers/spi/spi-omap-uwire.c | 4 ++-- It makes life easier if you send per-driver patches, that makes it easier for driver maintainers to review things and means that issues with a change in one driver won't hold up another.
> -----Original Messages----- > From: "Mark Brown" <broonie@kernel.org> > Sent Time: 2020-07-14 17:44:06 (Tuesday) > To: "Qing Zhang" <zhangqing@loongson.cn> > Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, "Xuefeng Li" <lixuefeng@loongson.cn>, "Tiezhu Yang" <yangtiezhu@loongson.cn> > Subject: Re: [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare > > On Tue, Jul 14, 2020 at 05:09:14PM +0800, Qing Zhang wrote: > > Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare > > calls as required by common clock framework. > > > > Signed-off-by: Qing Zhang <zhangqing@loongson.cn> > > --- > > drivers/spi/spi-coldfire-qspi.c | 4 ++-- > > Are you sure that ColdFire uses the common clock framework? > > > drivers/spi/spi-omap-uwire.c | 4 ++-- > > It makes life easier if you send per-driver patches, that makes it > easier for driver maintainers to review things and means that issues > with a change in one driver won't hold up another. Hi Mark, Thank you for your suggestion. I will split this patch into two patches and then send v2. </zhangqing@loongson.cn></yangtiezhu@loongson.cn></lixuefeng@loongson.cn></zhangqing@loongson.cn></broonie@kernel.org>
On Tue, Jul 14, 2020 at 11:45 AM Mark Brown <broonie@kernel.org> wrote: > On Tue, Jul 14, 2020 at 05:09:14PM +0800, Qing Zhang wrote: > > Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare > > calls as required by common clock framework. > > > > Signed-off-by: Qing Zhang <zhangqing@loongson.cn> > > --- > > drivers/spi/spi-coldfire-qspi.c | 4 ++-- > > Are you sure that ColdFire uses the common clock framework? Should be fine, as per include/linux/clk.h: #ifdef CONFIG_HAVE_CLK_PREPARE int clk_prepare(struct clk *clk); int __must_check clk_bulk_prepare(int num_clks, const struct clk_bulk_data *clks); #else static inline int clk_prepare(struct clk *clk) { might_sleep(); return 0; } static inline int __must_check clk_bulk_prepare(int num_clks, const struct clk_bulk_data *clks) { might_sleep(); return 0; } #endif Gr{oetje,eeting}s, Geert
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index f80e06c..8996115 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -387,7 +387,7 @@ static int mcfqspi_probe(struct platform_device *pdev) status = PTR_ERR(mcfqspi->clk); goto fail0; } - clk_enable(mcfqspi->clk); + clk_prepare_enable(mcfqspi->clk); master->bus_num = pdata->bus_num; master->num_chipselect = pdata->num_chipselect; @@ -425,7 +425,7 @@ static int mcfqspi_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mcfqspi_cs_teardown(mcfqspi); fail1: - clk_disable(mcfqspi->clk); + clk_disable_unprepare(mcfqspi->clk); fail0: spi_master_put(master); diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index ce8dbdb..71402f7 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -443,7 +443,7 @@ static void uwire_cleanup(struct spi_device *spi) static void uwire_off(struct uwire_spi *uwire) { uwire_write_reg(UWIRE_SR3, 0); - clk_disable(uwire->ck); + clk_disable_unprepare(uwire->ck); spi_master_put(uwire->bitbang.master); } @@ -475,7 +475,7 @@ static int uwire_probe(struct platform_device *pdev) spi_master_put(master); return status; } - clk_enable(uwire->ck); + clk_prepare_enable(uwire->ck); if (cpu_is_omap7xx()) uwire_idx_shift = 1;
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare calls as required by common clock framework. Signed-off-by: Qing Zhang <zhangqing@loongson.cn> --- drivers/spi/spi-coldfire-qspi.c | 4 ++-- drivers/spi/spi-omap-uwire.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)