linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_arasan_cf: fix ata_host_activate() failure handling
@ 2014-03-31 17:49 Bartlomiej Zolnierkiewicz
  2014-04-01  4:20 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-03-31 17:49 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Viresh Kumar, Shiraz Hashim, linux-ide, spear-devel,
	linux-arm-kernel, linux-kernel

Add missing cf_exit() and clk_put() calls to ata_host_activate()
failure path.

Cc: Viresh Kumar <viresh.linux@gmail.com>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/ata/pata_arasan_cf.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Index: b/drivers/ata/pata_arasan_cf.c
===================================================================
--- a/drivers/ata/pata_arasan_cf.c	2014-03-31 16:57:47.443727785 +0200
+++ b/drivers/ata/pata_arasan_cf.c	2014-03-31 17:09:48.171715498 +0200
@@ -898,9 +898,15 @@ static int arasan_cf_probe(struct platfo
 
 	cf_card_detect(acdev, 0);
 
-	return ata_host_activate(host, acdev->irq, irq_handler, 0,
-			&arasan_cf_sht);
+	ret = ata_host_activate(host, acdev->irq, irq_handler, 0,
+				&arasan_cf_sht);
+	if (ret)
+		goto exit_cf;
 
+	return 0;
+
+exit_cf:
+	cf_exit(acdev);
 free_clk:
 	clk_put(acdev->clk);
 	return ret;


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

* Re: [PATCH] pata_arasan_cf: fix ata_host_activate() failure handling
  2014-03-31 17:49 [PATCH] pata_arasan_cf: fix ata_host_activate() failure handling Bartlomiej Zolnierkiewicz
@ 2014-04-01  4:20 ` Viresh Kumar
  2014-04-14 16:00   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2014-04-01  4:20 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Tejun Heo, Shiraz Hashim, ...), spear-devel,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

On Mon, Mar 31, 2014 at 11:19 PM, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> Add missing cf_exit() and clk_put() calls to ata_host_activate()
> failure path.
>
> Cc: Viresh Kumar <viresh.linux@gmail.com>
> Cc: Shiraz Hashim <shiraz.hashim@st.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
>  drivers/ata/pata_arasan_cf.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> Index: b/drivers/ata/pata_arasan_cf.c
> ===================================================================
> --- a/drivers/ata/pata_arasan_cf.c      2014-03-31 16:57:47.443727785 +0200
> +++ b/drivers/ata/pata_arasan_cf.c      2014-03-31 17:09:48.171715498 +0200
> @@ -898,9 +898,15 @@ static int arasan_cf_probe(struct platfo
>
>         cf_card_detect(acdev, 0);
>
> -       return ata_host_activate(host, acdev->irq, irq_handler, 0,
> -                       &arasan_cf_sht);
> +       ret = ata_host_activate(host, acdev->irq, irq_handler, 0,
> +                               &arasan_cf_sht);
> +       if (ret)
> +               goto exit_cf;
>
> +       return 0;

Probably this would be better:

if (!ret)
    return 0

and then no need of a goto..

> +
> +exit_cf:
> +       cf_exit(acdev);
>  free_clk:
>         clk_put(acdev->clk);
>         return ret;
>

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

* Re: [PATCH] pata_arasan_cf: fix ata_host_activate() failure handling
  2014-04-01  4:20 ` Viresh Kumar
@ 2014-04-14 16:00   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-04-14 16:00 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Tejun Heo, Shiraz Hashim, ...), spear-devel,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org


Hi,

On Tuesday, April 01, 2014 09:50:42 AM Viresh Kumar wrote:
> On Mon, Mar 31, 2014 at 11:19 PM, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
> > Add missing cf_exit() and clk_put() calls to ata_host_activate()
> > failure path.
> >
> > Cc: Viresh Kumar <viresh.linux@gmail.com>
> > Cc: Shiraz Hashim <shiraz.hashim@st.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > ---
> >  drivers/ata/pata_arasan_cf.c |   10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > Index: b/drivers/ata/pata_arasan_cf.c
> > ===================================================================
> > --- a/drivers/ata/pata_arasan_cf.c      2014-03-31 16:57:47.443727785 +0200
> > +++ b/drivers/ata/pata_arasan_cf.c      2014-03-31 17:09:48.171715498 +0200
> > @@ -898,9 +898,15 @@ static int arasan_cf_probe(struct platfo
> >
> >         cf_card_detect(acdev, 0);
> >
> > -       return ata_host_activate(host, acdev->irq, irq_handler, 0,
> > -                       &arasan_cf_sht);
> > +       ret = ata_host_activate(host, acdev->irq, irq_handler, 0,
> > +                               &arasan_cf_sht);
> > +       if (ret)
> > +               goto exit_cf;
> >
> > +       return 0;
> 
> Probably this would be better:
> 
> if (!ret)
>     return 0
> 
> and then no need of a goto..

I considered doing it this way initially but decided that code consistency
with other host drivers is more important.  However if this is what you
prefer I'll re-do the patch and post it as v2.

> > +
> > +exit_cf:
> > +       cf_exit(acdev);
> >  free_clk:
> >         clk_put(acdev->clk);
> >         return ret;
> >

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

end of thread, other threads:[~2014-04-14 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 17:49 [PATCH] pata_arasan_cf: fix ata_host_activate() failure handling Bartlomiej Zolnierkiewicz
2014-04-01  4:20 ` Viresh Kumar
2014-04-14 16:00   ` Bartlomiej Zolnierkiewicz

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