* [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL).
@ 2012-03-30 15:05 ` Kenth Eriksson
0 siblings, 0 replies; 5+ messages in thread
From: Kenth Eriksson @ 2012-03-30 15:05 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
joakim.tjernlund-SNLAxHN9vbdl57MIdRCFDg
Cc: Kenth Eriksson
After commit 178db7d3 devices are initialized as children of the bus master, not children of the bus masters parent device. The pdata pointer used in fsl_spi_chipselect must updated to reflect the changed initialization.
Signed-off-by: Kenth Eriksson <kenth.eriksson-SNLAxHN9vbdl57MIdRCFDg@public.gmane.org>
---
drivers/spi/spi-fsl-spi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 7d6ca68..dc747a0 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -139,10 +139,12 @@ 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;
bool pol = spi->mode & SPI_CS_HIGH;
struct spi_mpc8xxx_cs *cs = spi->controller_state;
+ pdata = spi->dev.parent->parent->platform_data;
+
if (value == BITBANG_CS_INACTIVE) {
if (pdata->cs_control)
pdata->cs_control(spi, !pol);
--
1.7.3.4
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL).
@ 2012-03-30 15:05 ` Kenth Eriksson
0 siblings, 0 replies; 5+ messages in thread
From: Kenth Eriksson @ 2012-03-30 15:05 UTC (permalink / raw)
To: spi-devel-general, linuxppc-dev, joakim.tjernlund; +Cc: Kenth Eriksson
After commit 178db7d3 devices are initialized as children of the bus master, not children of the bus masters parent device. The pdata pointer used in fsl_spi_chipselect must updated to reflect the changed initialization.
Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
---
drivers/spi/spi-fsl-spi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 7d6ca68..dc747a0 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -139,10 +139,12 @@ 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;
bool pol = spi->mode & SPI_CS_HIGH;
struct spi_mpc8xxx_cs *cs = spi->controller_state;
+ pdata = spi->dev.parent->parent->platform_data;
+
if (value == BITBANG_CS_INACTIVE) {
if (pdata->cs_control)
pdata->cs_control(spi, !pol);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL).
2012-03-30 15:05 ` Kenth Eriksson
(?)
@ 2012-03-30 15:16 ` Joakim Tjernlund
-1 siblings, 0 replies; 5+ messages in thread
From: Joakim Tjernlund @ 2012-03-30 15:16 UTC (permalink / raw)
To: Kenth Eriksson; +Cc: spi-devel-general, linuxppc-dev
Kenth Eriksson <kenth.eriksson@transmode.com> wrote on 2012/03/30 17:05:30:
>
> After commit 178db7d3 devices are initialized as children of the bus master, not children of the bus masters parent device. The pdata pointer used in fsl_spi_chipselect must updated to reflect the changed initialization.
>
> Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL).
2012-03-30 15:05 ` Kenth Eriksson
@ 2012-03-30 22:25 ` Grant Likely
-1 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-03-30 22:25 UTC (permalink / raw)
To: Kenth Eriksson,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
joakim.tjernlund-SNLAxHN9vbdl57MIdRCFDg
Cc: Kenth Eriksson
On Fri, 30 Mar 2012 17:05:30 +0200, Kenth Eriksson <kenth.eriksson-SNLAxHN9vbdl57MIdRCFDg@public.gmane.org> wrote:
> After commit 178db7d3 devices are initialized as children of the bus master, not children of the bus masters parent device. The pdata pointer used in fsl_spi_chipselect must updated to reflect the changed initialization.
>
> Signed-off-by: Kenth Eriksson <kenth.eriksson-SNLAxHN9vbdl57MIdRCFDg@public.gmane.org>
Applied; but I have a comments on your commit text.
SHA1 id's are great for looking up commits, but they don't help at all
for casual readers on the mailing list or doing web searches. Please
always include the commit title when referencing an earlier commit. I
had to edit the commit text. Here is what I changed it to:
spi/mpc83xx: fix NULL pdata dereference bug
Commit 178db7d3, "spi: Fix device unregistration when unregistering
the bus master", changed device initialization to be children of the
bus master, not children of the bus masters parent device. The pdata
pointer used in fsl_spi_chipselect must updated to reflect the changed
initialization.
g.
> ---
> drivers/spi/spi-fsl-spi.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
> index 7d6ca68..dc747a0 100644
> --- a/drivers/spi/spi-fsl-spi.c
> +++ b/drivers/spi/spi-fsl-spi.c
> @@ -139,10 +139,12 @@ 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;
> bool pol = spi->mode & SPI_CS_HIGH;
> struct spi_mpc8xxx_cs *cs = spi->controller_state;
>
> + pdata = spi->dev.parent->parent->platform_data;
> +
> if (value == BITBANG_CS_INACTIVE) {
> if (pdata->cs_control)
> pdata->cs_control(spi, !pol);
> --
> 1.7.3.4
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL).
@ 2012-03-30 22:25 ` Grant Likely
0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-03-30 22:25 UTC (permalink / raw)
To: Kenth Eriksson, spi-devel-general, linuxppc-dev, joakim.tjernlund
Cc: Kenth Eriksson
On Fri, 30 Mar 2012 17:05:30 +0200, Kenth Eriksson <kenth.eriksson@transmode.com> wrote:
> After commit 178db7d3 devices are initialized as children of the bus master, not children of the bus masters parent device. The pdata pointer used in fsl_spi_chipselect must updated to reflect the changed initialization.
>
> Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
Applied; but I have a comments on your commit text.
SHA1 id's are great for looking up commits, but they don't help at all
for casual readers on the mailing list or doing web searches. Please
always include the commit title when referencing an earlier commit. I
had to edit the commit text. Here is what I changed it to:
spi/mpc83xx: fix NULL pdata dereference bug
Commit 178db7d3, "spi: Fix device unregistration when unregistering
the bus master", changed device initialization to be children of the
bus master, not children of the bus masters parent device. The pdata
pointer used in fsl_spi_chipselect must updated to reflect the changed
initialization.
g.
> ---
> drivers/spi/spi-fsl-spi.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
> index 7d6ca68..dc747a0 100644
> --- a/drivers/spi/spi-fsl-spi.c
> +++ b/drivers/spi/spi-fsl-spi.c
> @@ -139,10 +139,12 @@ 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;
> bool pol = spi->mode & SPI_CS_HIGH;
> struct spi_mpc8xxx_cs *cs = spi->controller_state;
>
> + pdata = spi->dev.parent->parent->platform_data;
> +
> if (value == BITBANG_CS_INACTIVE) {
> if (pdata->cs_control)
> pdata->cs_control(spi, !pol);
> --
> 1.7.3.4
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-31 0:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 15:05 [PATCH] Bug fix in commit 178db7d3 triggered a bug in the SPI driver for MPC83XX (pdata is NULL) Kenth Eriksson
2012-03-30 15:05 ` Kenth Eriksson
2012-03-30 15:16 ` Joakim Tjernlund
[not found] ` <1333119930-21129-1-git-send-email-kenth.eriksson-SNLAxHN9vbdl57MIdRCFDg@public.gmane.org>
2012-03-30 22:25 ` Grant Likely
2012-03-30 22:25 ` Grant Likely
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.