linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare
@ 2020-07-14  9:09 Qing Zhang
  2020-07-14  9:44 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Qing Zhang @ 2020-07-14  9:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Xuefeng Li, Tiezhu Yang, Qing Zhang

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(-)

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;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare
  2020-07-14  9:09 [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare Qing Zhang
@ 2020-07-14  9:44 ` Mark Brown
  2020-07-14 12:16   ` Qing Zhang
  2020-07-16  9:14   ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2020-07-14  9:44 UTC (permalink / raw)
  To: Qing Zhang; +Cc: linux-spi, linux-kernel, Xuefeng Li, Tiezhu Yang

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare
  2020-07-14  9:44 ` Mark Brown
@ 2020-07-14 12:16   ` Qing Zhang
  2020-07-16  9:14   ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Qing Zhang @ 2020-07-14 12:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Xuefeng Li, Tiezhu Yang




&gt; -----Original Messages-----
&gt; From: "Mark Brown" <broonie@kernel.org>
&gt; Sent Time: 2020-07-14 17:44:06 (Tuesday)
&gt; To: "Qing Zhang" <zhangqing@loongson.cn>
&gt; Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, "Xuefeng Li" <lixuefeng@loongson.cn>, "Tiezhu Yang" <yangtiezhu@loongson.cn>
&gt; Subject: Re: [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare
&gt; 
&gt; On Tue, Jul 14, 2020 at 05:09:14PM +0800, Qing Zhang wrote:
&gt; &gt; Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
&gt; &gt; calls as required by common clock framework.
&gt; &gt; 
&gt; &gt; Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
&gt; &gt; ---
&gt; &gt;  drivers/spi/spi-coldfire-qspi.c | 4 ++--
&gt; 
&gt; Are you sure that ColdFire uses the common clock framework?
&gt; 
&gt; &gt;  drivers/spi/spi-omap-uwire.c    | 4 ++--
&gt; 
&gt; It makes life easier if you send per-driver patches, that makes it
&gt; easier for driver maintainers to review things and means that issues
&gt; 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare
  2020-07-14  9:44 ` Mark Brown
  2020-07-14 12:16   ` Qing Zhang
@ 2020-07-16  9:14   ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-07-16  9:14 UTC (permalink / raw)
  To: Mark Brown
  Cc: Qing Zhang, linux-spi, Linux Kernel Mailing List, Xuefeng Li,
	Tiezhu Yang

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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-16  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  9:09 [PATCH] spi: Use clk_prepare_enable and clk_disable_unprepare Qing Zhang
2020-07-14  9:44 ` Mark Brown
2020-07-14 12:16   ` Qing Zhang
2020-07-16  9:14   ` Geert Uytterhoeven

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).