2015-12-24 05:58:55

by Glen Lee

[permalink] [raw]
Subject: [PATCH v2 1/2] staging: wilc1000: fix always return 0 error

This patch fixes a bug that return always 0 so it fails every time.

Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of io_init")
Signed-off-by: Glen Lee <[email protected]>
---
Changes in v2: separate v1 patch into two patches.
---
drivers/staging/wilc1000/wilc_sdio.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index e961b50..464d27d 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -614,8 +614,6 @@ static int sdio_init(struct wilc *wilc)
if (!wilc_sdio_init()) {
dev_err(&func->dev, "Failed io init bus...\n");
return 0;
- } else {
- return 0;
}

/**
--
1.9.1



2015-12-30 18:49:25

by Souptick Joarder

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] staging: wilc1000: fix always return 0 error

HI Glen,

On Thu, Dec 24, 2015 at 11:32 AM, Glen Lee <[email protected]> wrote:
> This patch fixes a bug that return always 0 so it fails every time.
>
> Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of io_init")
> Signed-off-by: Glen Lee <[email protected]>
> ---
> Changes in v2: separate v1 patch into two patches.
> ---
> drivers/staging/wilc1000/wilc_sdio.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
> index e961b50..464d27d 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -614,8 +614,6 @@ static int sdio_init(struct wilc *wilc)
> if (!wilc_sdio_init()) {
> dev_err(&func->dev, "Failed io init bus...\n");
> return 0;
> - } else {
> - return 0;
> }

I think it's better to handle the error case properly when
wilc_sdio_init() call fails.

>
> /**
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

-Souptick

2015-12-24 05:59:02

by Glen Lee

[permalink] [raw]
Subject: [PATCH v2 2/2] staging: wilc1000: remove wilc_sdio_init

wilc_sdio_init return always 1, which is needless. Remove it and it's related
codes also.

Signed-off-by: Glen Lee <[email protected]>
---
Changes in v2: separate v1 patch into two patches.
---
drivers/staging/wilc1000/wilc_sdio.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index 464d27d..caad876 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev)
dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n");
}

-static int wilc_sdio_init(void)
-{
- return 1;
-}
-
/********************************************
*
* Function 0
@@ -611,11 +606,6 @@ static int sdio_init(struct wilc *wilc)

g_sdio.irq_gpio = (wilc->dev_irq_num);

- if (!wilc_sdio_init()) {
- dev_err(&func->dev, "Failed io init bus...\n");
- return 0;
- }
-
/**
* function 0 csa enable
**/
--
1.9.1


2016-02-03 23:05:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] staging: wilc1000: fix always return 0 error

On Thu, Dec 31, 2015 at 12:19:25AM +0530, Souptick Joarder wrote:
> HI Glen,
>
> On Thu, Dec 24, 2015 at 11:32 AM, Glen Lee <[email protected]> wrote:
> > This patch fixes a bug that return always 0 so it fails every time.
> >
> > Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of io_init")
> > Signed-off-by: Glen Lee <[email protected]>
> > ---
> > Changes in v2: separate v1 patch into two patches.
> > ---
> > drivers/staging/wilc1000/wilc_sdio.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
> > index e961b50..464d27d 100644
> > --- a/drivers/staging/wilc1000/wilc_sdio.c
> > +++ b/drivers/staging/wilc1000/wilc_sdio.c
> > @@ -614,8 +614,6 @@ static int sdio_init(struct wilc *wilc)
> > if (!wilc_sdio_init()) {
> > dev_err(&func->dev, "Failed io init bus...\n");
> > return 0;
> > - } else {
> > - return 0;
> > }
>
> I think it's better to handle the error case properly when
> wilc_sdio_init() call fails.

It can't :)