linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data
@ 2012-06-26  2:32 Xu Jiucheng
       [not found] ` <1340677936-6967-1-git-send-email-B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Xu Jiucheng @ 2012-06-26  2:32 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Xu Jiucheng

In the spi_alloc_device(), the parent pointer of spi deivce has
been changed from master->dev.parent to &master->dev for device
unregistration, so the pointer of getting the platform data as
this 'spi->dev.parent->platform_data' is wrong.

Signed-off-by: Xu Jiucheng <B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/spi/spi_fsl_spi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_fsl_spi.c b/drivers/spi/spi_fsl_spi.c
index 7963c9b..7d164d3 100644
--- a/drivers/spi/spi_fsl_spi.c
+++ b/drivers/spi/spi_fsl_spi.c
@@ -139,7 +139,7 @@ static void fsl_spi_change_mode(struct spi_device *spi)
 static void fsl_spi_chipselect(struct spi_device *spi, int value)
 {
 	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
-	struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
+	struct fsl_spi_platform_data *pdata = mpc8xxx_spi->dev->platform_data;
 	bool pol = spi->mode & SPI_CS_HIGH;
 	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
 
@@ -934,7 +934,8 @@ err:
 
 static void fsl_spi_cs_control(struct spi_device *spi, bool on)
 {
-	struct device *dev = spi->dev.parent;
+	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
+	struct device *dev = mpc8xxx_spi->dev;
 	struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
 	u16 cs = spi->chip_select;
 	int gpio = pinfo->gpios[cs];
-- 
1.6.4



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* Re: [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data
       [not found] ` <1340677936-6967-1-git-send-email-B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2012-07-18  3:21   ` Jiucheng Xu
  2012-07-18  3:44   ` Jiucheng Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Jiucheng Xu @ 2012-07-18  3:21 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi All,

	I'm sorry, please ignore this patch.

-- 
Best Regards,
Jiucheng


On Tue, 2012-06-26 at 10:32 +0800, Xu Jiucheng wrote:
> In the spi_alloc_device(), the parent pointer of spi deivce has
> been changed from master->dev.parent to &master->dev for device
> unregistration, so the pointer of getting the platform data as
> this 'spi->dev.parent->platform_data' is wrong.
> 
> Signed-off-by: Xu Jiucheng <B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
>  drivers/spi/spi_fsl_spi.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi_fsl_spi.c b/drivers/spi/spi_fsl_spi.c
> index 7963c9b..7d164d3 100644
> --- a/drivers/spi/spi_fsl_spi.c
> +++ b/drivers/spi/spi_fsl_spi.c
> @@ -139,7 +139,7 @@ static void fsl_spi_change_mode(struct spi_device *spi)
>  static void fsl_spi_chipselect(struct spi_device *spi, int value)
>  {
>  	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
> -	struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
> +	struct fsl_spi_platform_data *pdata = mpc8xxx_spi->dev->platform_data;
>  	bool pol = spi->mode & SPI_CS_HIGH;
>  	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
>  
> @@ -934,7 +934,8 @@ err:
>  
>  static void fsl_spi_cs_control(struct spi_device *spi, bool on)
>  {
> -	struct device *dev = spi->dev.parent;
> +	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
> +	struct device *dev = mpc8xxx_spi->dev;
>  	struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
>  	u16 cs = spi->chip_select;
>  	int gpio = pinfo->gpios[cs];



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* Re: [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data
       [not found] ` <1340677936-6967-1-git-send-email-B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2012-07-18  3:21   ` Jiucheng Xu
@ 2012-07-18  3:44   ` Jiucheng Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Jiucheng Xu @ 2012-07-18  3:44 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, spi-devel-general

Hi all,

	I'm sorry, this patch is invalid, please ignore it, I will resend a new
patch base on the last tree. Thanks.

-- 
Best Regards,
Jiucheng


On Tue, 2012-06-26 at 10:32 +0800, Xu Jiucheng wrote:
> In the spi_alloc_device(), the parent pointer of spi deivce has
> been changed from master->dev.parent to &master->dev for device
> unregistration, so the pointer of getting the platform data as
> this 'spi->dev.parent->platform_data' is wrong.
> 
> Signed-off-by: Xu Jiucheng <B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
>  drivers/spi/spi_fsl_spi.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi_fsl_spi.c b/drivers/spi/spi_fsl_spi.c
> index 7963c9b..7d164d3 100644
> --- a/drivers/spi/spi_fsl_spi.c
> +++ b/drivers/spi/spi_fsl_spi.c
> @@ -139,7 +139,7 @@ static void fsl_spi_change_mode(struct spi_device *spi)
>  static void fsl_spi_chipselect(struct spi_device *spi, int value)
>  {
>  	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
> -	struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
> +	struct fsl_spi_platform_data *pdata = mpc8xxx_spi->dev->platform_data;
>  	bool pol = spi->mode & SPI_CS_HIGH;
>  	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
>  
> @@ -934,7 +934,8 @@ err:
>  
>  static void fsl_spi_cs_control(struct spi_device *spi, bool on)
>  {
> -	struct device *dev = spi->dev.parent;
> +	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
> +	struct device *dev = mpc8xxx_spi->dev;
>  	struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
>  	u16 cs = spi->chip_select;
>  	int gpio = pinfo->gpios[cs];



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data
@ 2012-07-30  9:10 Jiucheng Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Jiucheng Xu @ 2012-07-30  9:10 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Jiucheng Xu

In the spi_alloc_device(), the parent pointer of spi deivce has
been changed from master->dev.parent to &master->dev for device
unregistration, so the pointer of getting the platform data as
this 'spi->dev.parent->platform_data' is wrong.

Signed-off-by: Jiucheng Xu <Jiucheng.Xu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/spi/spi-fsl-spi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 6a62934..27059a6 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -143,7 +143,7 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value)
 	bool pol = spi->mode & SPI_CS_HIGH;
 	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
 
-	pdata = spi->dev.parent->parent->platform_data;
+	pdata = mpc8xxx_spi->dev->platform_data;
 
 	if (value == BITBANG_CS_INACTIVE) {
 		if (pdata->cs_control)
@@ -933,7 +933,8 @@ err:
 
 static void fsl_spi_cs_control(struct spi_device *spi, bool on)
 {
-	struct device *dev = spi->dev.parent->parent;
+	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
+	struct device *dev = mpc8xxx_spi->dev;
 	struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
 	u16 cs = spi->chip_select;
 	int gpio = pinfo->gpios[cs];
-- 
1.6.4



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data
@ 2012-07-12  3:18 Jiucheng Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Jiucheng Xu @ 2012-07-12  3:18 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Xu Jiucheng

From: Xu Jiucheng <Jiucheng.Xu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

In the spi_alloc_device(), the parent pointer of spi deivce has
been changed from master->dev.parent to &master->dev for device
unregistration, so the pointer of getting the platform data as
this 'spi->dev.parent->platform_data' is wrong.

Signed-off-by: Xu Jiucheng <Jiucheng.Xu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/spi/spi_fsl_spi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_fsl_spi.c b/drivers/spi/spi_fsl_spi.c
index 7963c9b..7d164d3 100644
--- a/drivers/spi/spi_fsl_spi.c
+++ b/drivers/spi/spi_fsl_spi.c
@@ -139,7 +139,7 @@ static void fsl_spi_change_mode(struct spi_device *spi)
 static void fsl_spi_chipselect(struct spi_device *spi, int value)
 {
 	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
-	struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
+	struct fsl_spi_platform_data *pdata = mpc8xxx_spi->dev->platform_data;
 	bool pol = spi->mode & SPI_CS_HIGH;
 	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
 
@@ -934,7 +934,8 @@ err:
 
 static void fsl_spi_cs_control(struct spi_device *spi, bool on)
 {
-	struct device *dev = spi->dev.parent;
+	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
+	struct device *dev = mpc8xxx_spi->dev;
 	struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
 	u16 cs = spi->chip_select;
 	int gpio = pinfo->gpios[cs];
-- 
1.6.4



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

end of thread, other threads:[~2012-07-30  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26  2:32 [PATCH] spi/mpc8xxx:Fix the wrong pointer of getting the platform data Xu Jiucheng
     [not found] ` <1340677936-6967-1-git-send-email-B37781-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-07-18  3:21   ` Jiucheng Xu
2012-07-18  3:44   ` Jiucheng Xu
2012-07-12  3:18 Jiucheng Xu
2012-07-30  9:10 Jiucheng Xu

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