* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-16 4:48 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-16 4:48 UTC (permalink / raw)
To: linux-arm-kernel
This patch updates the marzen board code as if USB PHY isn't enabled
they phy will have a value set by ERR_PTR() rather than be NULL.
Without this patch a NULL pointer dereference and kernel panic
occurs on initialisation of USB on marzen.
This resolves a regression introduced in 3.10-rc1 by
b7fa5c2aec5be083eb2719b405089703608e9bc6
("usb: phy: return -ENXIO when PHY layer isn't enabled").
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/board-marzen.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 9105285..b9594e9 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
static struct usb_phy *phy;
static int usb_power_on(struct platform_device *pdev)
{
- if (!phy)
- return -EIO;
+ if (IS_ERR(phy))
+ return PTR_ERR(phy);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
static void usb_power_off(struct platform_device *pdev)
{
- if (!phy)
+ if (IS_ERR(phy))
return;
usb_phy_shutdown(phy);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-16 4:48 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-16 4:48 UTC (permalink / raw)
To: linux-arm-kernel
This patch updates the marzen board code as if USB PHY isn't enabled
they phy will have a value set by ERR_PTR() rather than be NULL.
Without this patch a NULL pointer dereference and kernel panic
occurs on initialisation of USB on marzen.
This resolves a regression introduced in 3.10-rc1 by
b7fa5c2aec5be083eb2719b405089703608e9bc6
("usb: phy: return -ENXIO when PHY layer isn't enabled").
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/board-marzen.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 9105285..b9594e9 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
static struct usb_phy *phy;
static int usb_power_on(struct platform_device *pdev)
{
- if (!phy)
- return -EIO;
+ if (IS_ERR(phy))
+ return PTR_ERR(phy);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
static void usb_power_off(struct platform_device *pdev)
{
- if (!phy)
+ if (IS_ERR(phy))
return;
usb_phy_shutdown(phy);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
2013-05-16 4:48 ` Simon Horman
@ 2013-05-21 7:51 ` Nguyen Hong Ky
-1 siblings, 0 replies; 10+ messages in thread
From: Nguyen Hong Ky @ 2013-05-21 7:51 UTC (permalink / raw)
To: linux-arm-kernel
Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
On Thu, May 16, 2013 at 1:48 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> This patch updates the marzen board code as if USB PHY isn't enabled
> they phy will have a value set by ERR_PTR() rather than be NULL.
>
> Without this patch a NULL pointer dereference and kernel panic
> occurs on initialisation of USB on marzen.
>
> This resolves a regression introduced in 3.10-rc1 by
> b7fa5c2aec5be083eb2719b405089703608e9bc6
> ("usb: phy: return -ENXIO when PHY layer isn't enabled").
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 9105285..b9594e9 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> static struct usb_phy *phy;
> static int usb_power_on(struct platform_device *pdev)
> {
> - if (!phy)
> - return -EIO;
> + if (IS_ERR(phy))
> + return PTR_ERR(phy);
>
> pm_runtime_enable(&pdev->dev);
> pm_runtime_get_sync(&pdev->dev);
> @@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
>
> static void usb_power_off(struct platform_device *pdev)
> {
> - if (!phy)
> + if (IS_ERR(phy))
> return;
>
> usb_phy_shutdown(phy);
> --
> 1.8.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-21 7:51 ` Nguyen Hong Ky
0 siblings, 0 replies; 10+ messages in thread
From: Nguyen Hong Ky @ 2013-05-21 7:51 UTC (permalink / raw)
To: linux-arm-kernel
Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
On Thu, May 16, 2013 at 1:48 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> This patch updates the marzen board code as if USB PHY isn't enabled
> they phy will have a value set by ERR_PTR() rather than be NULL.
>
> Without this patch a NULL pointer dereference and kernel panic
> occurs on initialisation of USB on marzen.
>
> This resolves a regression introduced in 3.10-rc1 by
> b7fa5c2aec5be083eb2719b405089703608e9bc6
> ("usb: phy: return -ENXIO when PHY layer isn't enabled").
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 9105285..b9594e9 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> static struct usb_phy *phy;
> static int usb_power_on(struct platform_device *pdev)
> {
> - if (!phy)
> - return -EIO;
> + if (IS_ERR(phy))
> + return PTR_ERR(phy);
>
> pm_runtime_enable(&pdev->dev);
> pm_runtime_get_sync(&pdev->dev);
> @@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
>
> static void usb_power_off(struct platform_device *pdev)
> {
> - if (!phy)
> + if (IS_ERR(phy))
> return;
>
> usb_phy_shutdown(phy);
> --
> 1.8.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
2013-05-22 19:50 ` Sergei Shtylyov
@ 2013-05-25 0:59 ` Simon Horman
-1 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-25 0:59 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 22, 2013 at 11:50:21PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 05/22/2013 10:48 AM, Simon Horman wrote:
>
> >This patch updates the marzen board code as if USB PHY isn't enabled
> >they phy will have a value set by ERR_PTR() rather than be NULL.
> >
> >Without this patch a NULL pointer dereference and kernel panic
> >occurs on initialisation of USB on marzen.
> >
> >This resolves a regression introduced in 3.10-rc1 by
> >b7fa5c2aec5be083eb2719b405089703608e9bc6
> >("usb: phy: return -ENXIO when PHY layer isn't enabled").
> >
> >Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> > arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> >index 9105285..b9594e9 100644
> >--- a/arch/arm/mach-shmobile/board-marzen.c
> >+++ b/arch/arm/mach-shmobile/board-marzen.c
> >@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> > static struct usb_phy *phy;
> > static int usb_power_on(struct platform_device *pdev)
> > {
> >- if (!phy)
> >- return -EIO;
> >+ if (IS_ERR(phy))
>
> And even before the mentioned commit the right check should have
> been IS_ERR_OR_NULL().
Yes, quite true.
> Thanks for finding/fixing this. Too bad I'll have to respin my USB
> patches now... :-)
>
> WBR, Sergei
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-25 0:59 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-25 0:59 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 22, 2013 at 11:50:21PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 05/22/2013 10:48 AM, Simon Horman wrote:
>
> >This patch updates the marzen board code as if USB PHY isn't enabled
> >they phy will have a value set by ERR_PTR() rather than be NULL.
> >
> >Without this patch a NULL pointer dereference and kernel panic
> >occurs on initialisation of USB on marzen.
> >
> >This resolves a regression introduced in 3.10-rc1 by
> >b7fa5c2aec5be083eb2719b405089703608e9bc6
> >("usb: phy: return -ENXIO when PHY layer isn't enabled").
> >
> >Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> > arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> >index 9105285..b9594e9 100644
> >--- a/arch/arm/mach-shmobile/board-marzen.c
> >+++ b/arch/arm/mach-shmobile/board-marzen.c
> >@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> > static struct usb_phy *phy;
> > static int usb_power_on(struct platform_device *pdev)
> > {
> >- if (!phy)
> >- return -EIO;
> >+ if (IS_ERR(phy))
>
> And even before the mentioned commit the right check should have
> been IS_ERR_OR_NULL().
Yes, quite true.
> Thanks for finding/fixing this. Too bad I'll have to respin my USB
> patches now... :-)
>
> WBR, Sergei
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
2013-05-22 6:48 ` Simon Horman
@ 2013-05-22 19:50 ` Sergei Shtylyov
-1 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-05-22 19:50 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 05/22/2013 10:48 AM, Simon Horman wrote:
> This patch updates the marzen board code as if USB PHY isn't enabled
> they phy will have a value set by ERR_PTR() rather than be NULL.
>
> Without this patch a NULL pointer dereference and kernel panic
> occurs on initialisation of USB on marzen.
>
> This resolves a regression introduced in 3.10-rc1 by
> b7fa5c2aec5be083eb2719b405089703608e9bc6
> ("usb: phy: return -ENXIO when PHY layer isn't enabled").
>
> Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 9105285..b9594e9 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> static struct usb_phy *phy;
> static int usb_power_on(struct platform_device *pdev)
> {
> - if (!phy)
> - return -EIO;
> + if (IS_ERR(phy))
And even before the mentioned commit the right check should have
been IS_ERR_OR_NULL().
Thanks for finding/fixing this. Too bad I'll have to respin my USB
patches now... :-)
WBR, Sergei
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-22 19:50 ` Sergei Shtylyov
0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-05-22 19:50 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 05/22/2013 10:48 AM, Simon Horman wrote:
> This patch updates the marzen board code as if USB PHY isn't enabled
> they phy will have a value set by ERR_PTR() rather than be NULL.
>
> Without this patch a NULL pointer dereference and kernel panic
> occurs on initialisation of USB on marzen.
>
> This resolves a regression introduced in 3.10-rc1 by
> b7fa5c2aec5be083eb2719b405089703608e9bc6
> ("usb: phy: return -ENXIO when PHY layer isn't enabled").
>
> Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> arch/arm/mach-shmobile/board-marzen.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 9105285..b9594e9 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
> static struct usb_phy *phy;
> static int usb_power_on(struct platform_device *pdev)
> {
> - if (!phy)
> - return -EIO;
> + if (IS_ERR(phy))
And even before the mentioned commit the right check should have
been IS_ERR_OR_NULL().
Thanks for finding/fixing this. Too bad I'll have to respin my USB
patches now... :-)
WBR, Sergei
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
2013-05-22 6:48 [GIT PULL] Renesas ARM SoC based marzen board fix for v3.10 Simon Horman
@ 2013-05-22 6:48 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-22 6:48 UTC (permalink / raw)
To: linux-arm-kernel
This patch updates the marzen board code as if USB PHY isn't enabled
they phy will have a value set by ERR_PTR() rather than be NULL.
Without this patch a NULL pointer dereference and kernel panic
occurs on initialisation of USB on marzen.
This resolves a regression introduced in 3.10-rc1 by
b7fa5c2aec5be083eb2719b405089703608e9bc6
("usb: phy: return -ENXIO when PHY layer isn't enabled").
Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/board-marzen.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 9105285..b9594e9 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
static struct usb_phy *phy;
static int usb_power_on(struct platform_device *pdev)
{
- if (!phy)
- return -EIO;
+ if (IS_ERR(phy))
+ return PTR_ERR(phy);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
static void usb_power_off(struct platform_device *pdev)
{
- if (!phy)
+ if (IS_ERR(phy))
return;
usb_phy_shutdown(phy);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
@ 2013-05-22 6:48 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-05-22 6:48 UTC (permalink / raw)
To: linux-arm-kernel
This patch updates the marzen board code as if USB PHY isn't enabled
they phy will have a value set by ERR_PTR() rather than be NULL.
Without this patch a NULL pointer dereference and kernel panic
occurs on initialisation of USB on marzen.
This resolves a regression introduced in 3.10-rc1 by
b7fa5c2aec5be083eb2719b405089703608e9bc6
("usb: phy: return -ENXIO when PHY layer isn't enabled").
Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/board-marzen.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 9105285..b9594e9 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
static struct usb_phy *phy;
static int usb_power_on(struct platform_device *pdev)
{
- if (!phy)
- return -EIO;
+ if (IS_ERR(phy))
+ return PTR_ERR(phy);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
static void usb_power_off(struct platform_device *pdev)
{
- if (!phy)
+ if (IS_ERR(phy))
return;
usb_phy_shutdown(phy);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-05-25 0:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-16 4:48 [PATCH] ARM: shmobile: marzen: Use error values in usb_power_* Simon Horman
2013-05-16 4:48 ` Simon Horman
2013-05-21 7:51 ` Nguyen Hong Ky
2013-05-21 7:51 ` Nguyen Hong Ky
2013-05-22 6:48 [GIT PULL] Renesas ARM SoC based marzen board fix for v3.10 Simon Horman
2013-05-22 6:48 ` [PATCH] ARM: shmobile: marzen: Use error values in usb_power_* Simon Horman
2013-05-22 6:48 ` Simon Horman
2013-05-22 19:50 ` Sergei Shtylyov
2013-05-22 19:50 ` Sergei Shtylyov
2013-05-25 0:59 ` Simon Horman
2013-05-25 0:59 ` Simon Horman
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.