* [PATCH] spi: fsl-dspi: Fix getting correct address for master
@ 2014-02-14 4:49 Axel Lin
2014-03-02 15:09 ` Axel Lin
2014-03-05 3:49 ` Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Axel Lin @ 2014-02-14 4:49 UTC (permalink / raw)
To: Mark Brown; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
Current code set platform drvdata to dspi. However, the code in dspi_suspend()
and dspi_resume() assumes the drvdata is the address of master.
Fix it by setting platform drvdata to master.
Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
drivers/spi/spi-fsl-dspi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index ec79f72..a253920 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -420,7 +420,6 @@ static int dspi_suspend(struct device *dev)
static int dspi_resume(struct device *dev)
{
-
struct spi_master *master = dev_get_drvdata(dev);
struct fsl_dspi *dspi = spi_master_get_devdata(master);
@@ -504,7 +503,7 @@ static int dspi_probe(struct platform_device *pdev)
clk_prepare_enable(dspi->clk);
init_waitqueue_head(&dspi->waitq);
- platform_set_drvdata(pdev, dspi);
+ platform_set_drvdata(pdev, master);
ret = spi_bitbang_start(&dspi->bitbang);
if (ret != 0) {
@@ -525,7 +524,8 @@ out_master_put:
static int dspi_remove(struct platform_device *pdev)
{
- struct fsl_dspi *dspi = platform_get_drvdata(pdev);
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct fsl_dspi *dspi = spi_master_get_devdata(master);
/* Disconnect from the SPI framework */
spi_bitbang_stop(&dspi->bitbang);
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: fsl-dspi: Fix getting correct address for master
2014-02-14 4:49 [PATCH] spi: fsl-dspi: Fix getting correct address for master Axel Lin
@ 2014-03-02 15:09 ` Axel Lin
[not found] ` <CAFRkauD3WFBw9VC6h+2bxcnuky7175G47+7tP8=5f4D2PeLpEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-05 3:49 ` Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Axel Lin @ 2014-03-02 15:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
2014-02-14 12:49 GMT+08:00 Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>:
> Current code set platform drvdata to dspi. However, the code in dspi_suspend()
> and dspi_resume() assumes the drvdata is the address of master.
> Fix it by setting platform drvdata to master.
Hi Mark,
I guess this one is for 3.14.
In dspi_probe(),
current code has:
platform_set_drvdata(pdev, dspi);
However, in dspi_suspend() and dspi_resume(),
current code has:
struct spi_master *master = dev_get_drvdata(dev);
Regards,
Axel
>
> Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/spi/spi-fsl-dspi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index ec79f72..a253920 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -420,7 +420,6 @@ static int dspi_suspend(struct device *dev)
>
> static int dspi_resume(struct device *dev)
> {
> -
> struct spi_master *master = dev_get_drvdata(dev);
> struct fsl_dspi *dspi = spi_master_get_devdata(master);
>
> @@ -504,7 +503,7 @@ static int dspi_probe(struct platform_device *pdev)
> clk_prepare_enable(dspi->clk);
>
> init_waitqueue_head(&dspi->waitq);
> - platform_set_drvdata(pdev, dspi);
> + platform_set_drvdata(pdev, master);
>
> ret = spi_bitbang_start(&dspi->bitbang);
> if (ret != 0) {
> @@ -525,7 +524,8 @@ out_master_put:
>
> static int dspi_remove(struct platform_device *pdev)
> {
> - struct fsl_dspi *dspi = platform_get_drvdata(pdev);
> + struct spi_master *master = platform_get_drvdata(pdev);
> + struct fsl_dspi *dspi = spi_master_get_devdata(master);
>
> /* Disconnect from the SPI framework */
> spi_bitbang_stop(&dspi->bitbang);
> --
> 1.8.1.2
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: fsl-dspi: Fix getting correct address for master
[not found] ` <CAFRkauD3WFBw9VC6h+2bxcnuky7175G47+7tP8=5f4D2PeLpEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-03-03 1:46 ` Mark Brown
[not found] ` <20140303014608.GL2411-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2014-03-03 1:46 UTC (permalink / raw)
To: Axel Lin; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]
On Sun, Mar 02, 2014 at 11:09:41PM +0800, Axel Lin wrote:
> 2014-02-14 12:49 GMT+08:00 Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>:
> > Current code set platform drvdata to dspi. However, the code in dspi_suspend()
> > and dspi_resume() assumes the drvdata is the address of master.
> > Fix it by setting platform drvdata to master.
> Hi Mark,
> I guess this one is for 3.14.
> In dspi_probe(),
> current code has:
> platform_set_drvdata(pdev, dspi);
> However, in dspi_suspend() and dspi_resume(),
> current code has:
> struct spi_master *master = dev_get_drvdata(dev);
The patch doesn't seem to have been appleid at all?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: fsl-dspi: Fix getting correct address for master
[not found] ` <20140303014608.GL2411-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-03-03 8:42 ` Axel Lin
[not found] ` <CAFRkauC7z4UepyK-oH861OEo62+4b82idWPAkK99vmY0=T3w9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Axel Lin @ 2014-03-03 8:42 UTC (permalink / raw)
To: Mark Brown; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
2014-03-03 9:46 GMT+08:00 Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>:
> On Sun, Mar 02, 2014 at 11:09:41PM +0800, Axel Lin wrote:
>> 2014-02-14 12:49 GMT+08:00 Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>:
>> > Current code set platform drvdata to dspi. However, the code in dspi_suspend()
>> > and dspi_resume() assumes the drvdata is the address of master.
>> > Fix it by setting platform drvdata to master.
>
>> Hi Mark,
>> I guess this one is for 3.14.
>
>> In dspi_probe(),
>> current code has:
>> platform_set_drvdata(pdev, dspi);
>
>> However, in dspi_suspend() and dspi_resume(),
>> current code has:
>> struct spi_master *master = dev_get_drvdata(dev);
>
> The patch doesn't seem to have been appleid at all?
Ah, right , this one is not yet in your tree.
And I think a similar patch for coldfire-qspi needs for 3.14 to make
runtime suspend/resume work.
commit 80467f761b01a2df5284661e9bf9876eee6a9573
spi: coldfire-qspi: Fix getting correct address for *mcfqspi
dev_get_drvdata() returns the address of master rather than mcfqspi.
Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: fsl-dspi: Fix getting correct address for master
2014-02-14 4:49 [PATCH] spi: fsl-dspi: Fix getting correct address for master Axel Lin
2014-03-02 15:09 ` Axel Lin
@ 2014-03-05 3:49 ` Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-03-05 3:49 UTC (permalink / raw)
To: Axel Lin; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On Fri, Feb 14, 2014 at 12:49:12PM +0800, Axel Lin wrote:
> Current code set platform drvdata to dspi. However, the code in dspi_suspend()
> and dspi_resume() assumes the drvdata is the address of master.
> Fix it by setting platform drvdata to master.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: fsl-dspi: Fix getting correct address for master
[not found] ` <CAFRkauC7z4UepyK-oH861OEo62+4b82idWPAkK99vmY0=T3w9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-03-05 3:54 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-03-05 3:54 UTC (permalink / raw)
To: Axel Lin; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
On Mon, Mar 03, 2014 at 04:42:19PM +0800, Axel Lin wrote:
> And I think a similar patch for coldfire-qspi needs for 3.14 to make
> runtime suspend/resume work.
> commit 80467f761b01a2df5284661e9bf9876eee6a9573
> spi: coldfire-qspi: Fix getting correct address for *mcfqspi
> dev_get_drvdata() returns the address of master rather than mcfqspi.
Yes, looks like it.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-05 3:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 4:49 [PATCH] spi: fsl-dspi: Fix getting correct address for master Axel Lin
2014-03-02 15:09 ` Axel Lin
[not found] ` <CAFRkauD3WFBw9VC6h+2bxcnuky7175G47+7tP8=5f4D2PeLpEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-03 1:46 ` Mark Brown
[not found] ` <20140303014608.GL2411-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-03-03 8:42 ` Axel Lin
[not found] ` <CAFRkauC7z4UepyK-oH861OEo62+4b82idWPAkK99vmY0=T3w9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-05 3:54 ` Mark Brown
2014-03-05 3:49 ` Mark Brown
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).