public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] uio: clean uioinfo when uninstall uio driver
@ 2011-04-02  8:55 Aisheng Dong
  2011-04-04 17:16 ` Hans J. Koch
  0 siblings, 1 reply; 3+ messages in thread
From: Aisheng Dong @ 2011-04-02  8:55 UTC (permalink / raw)
  To: hjk, greg; +Cc: linux-kernel

From: Jie Zhou <b30303@freescale.com>

The uioinfo should be cleaned up when uninstall, otherwise re-install
failure of uio_pdrv_genirq.ko will happen.

Signed-off-by: Jie Zhou <b30303@freescale.com>
Signed-off-by: Aisheng Dong <b29396@freescale.com>
---
 drivers/uio/uio_pdrv_genirq.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 7174d51..e669a2c 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -189,6 +189,12 @@ static int uio_pdrv_genirq_remove(struct platform_device *pdev)
 
 	uio_unregister_device(priv->uioinfo);
 	pm_runtime_disable(&pdev->dev);
+
+	priv->uioinfo->irq_flags = 0;
+	priv->uioinfo->handler = NULL;
+	priv->uioinfo->irqcontrol = NULL;
+	priv->uioinfo->priv = NULL;
+
 	kfree(priv);
 	return 0;
 }
-- 
1.7.0.4



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

* Re: [PATCH 1/1] uio: clean uioinfo when uninstall uio driver
  2011-04-02  8:55 [PATCH 1/1] uio: clean uioinfo when uninstall uio driver Aisheng Dong
@ 2011-04-04 17:16 ` Hans J. Koch
  2011-04-06  6:11   ` Dong Aisheng-B29396
  0 siblings, 1 reply; 3+ messages in thread
From: Hans J. Koch @ 2011-04-04 17:16 UTC (permalink / raw)
  To: Aisheng Dong; +Cc: hjk, greg, linux-kernel

On Sat, Apr 02, 2011 at 04:55:23PM +0800, Aisheng Dong wrote:
> From: Jie Zhou <b30303@freescale.com>
> 
> The uioinfo should be cleaned up when uninstall, otherwise re-install
> failure of uio_pdrv_genirq.ko will happen.
> 
> Signed-off-by: Jie Zhou <b30303@freescale.com>
> Signed-off-by: Aisheng Dong <b29396@freescale.com>
> ---
>  drivers/uio/uio_pdrv_genirq.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
> index 7174d51..e669a2c 100644
> --- a/drivers/uio/uio_pdrv_genirq.c
> +++ b/drivers/uio/uio_pdrv_genirq.c
> @@ -189,6 +189,12 @@ static int uio_pdrv_genirq_remove(struct platform_device *pdev)
>  
>  	uio_unregister_device(priv->uioinfo);
>  	pm_runtime_disable(&pdev->dev);
> +
> +	priv->uioinfo->irq_flags = 0;

Why this one?

> +	priv->uioinfo->handler = NULL;
> +	priv->uioinfo->irqcontrol = NULL;

Both OK, good catch!

> +	priv->uioinfo->priv = NULL;

Why this one?

> +
>  	kfree(priv);
>  	return 0;
>  }

Thanks,
Hans


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

* RE: [PATCH 1/1] uio: clean uioinfo when uninstall uio driver
  2011-04-04 17:16 ` Hans J. Koch
@ 2011-04-06  6:11   ` Dong Aisheng-B29396
  0 siblings, 0 replies; 3+ messages in thread
From: Dong Aisheng-B29396 @ 2011-04-06  6:11 UTC (permalink / raw)
  To: Hans J. Koch
  Cc: greg@kroah.com, linux-kernel@vger.kernel.org, Zhou Jie-B30303

> -----Original Message-----
> From: Hans J. Koch [mailto:hjk@hansjkoch.de]
> Sent: Tuesday, April 05, 2011 1:16 AM
> To: Dong Aisheng-B29396
> Cc: hjk@hansjkoch.de; greg@kroah.com; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/1] uio: clean uioinfo when uninstall uio driver
> 
> On Sat, Apr 02, 2011 at 04:55:23PM +0800, Aisheng Dong wrote:
> > From: Jie Zhou <b30303@freescale.com>
> >
> > The uioinfo should be cleaned up when uninstall, otherwise re-install
> > failure of uio_pdrv_genirq.ko will happen.
> >
> > Signed-off-by: Jie Zhou <b30303@freescale.com>
> > Signed-off-by: Aisheng Dong <b29396@freescale.com>
> > ---
> >  drivers/uio/uio_pdrv_genirq.c |    6 ++++++
> >  1 files changed, 6 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/uio/uio_pdrv_genirq.c
> > b/drivers/uio/uio_pdrv_genirq.c index 7174d51..e669a2c 100644
> > --- a/drivers/uio/uio_pdrv_genirq.c
> > +++ b/drivers/uio/uio_pdrv_genirq.c
> > @@ -189,6 +189,12 @@ static int uio_pdrv_genirq_remove(struct
> > platform_device *pdev)
> >
> >  	uio_unregister_device(priv->uioinfo);
> >  	pm_runtime_disable(&pdev->dev);
> > +
> > +	priv->uioinfo->irq_flags = 0;
> 
> Why this one?
Could be removed.

> > +	priv->uioinfo->handler = NULL;
> > +	priv->uioinfo->irqcontrol = NULL;
> 
> Both OK, good catch!
> 
> > +	priv->uioinfo->priv = NULL;
> 
> Why this one?
Could be removed.

Thanks for the info.
The V2 patch will be soon.


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

end of thread, other threads:[~2011-04-06  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  8:55 [PATCH 1/1] uio: clean uioinfo when uninstall uio driver Aisheng Dong
2011-04-04 17:16 ` Hans J. Koch
2011-04-06  6:11   ` Dong Aisheng-B29396

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox