LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch 3/4] ipmi: add pci remove handling
@ 2007-02-14 20:06 Corey Minyard
  2007-02-15 10:27 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Corey Minyard @ 2007-02-14 20:06 UTC (permalink / raw)
  To: Linux Kernel, Andrew Morton


Add pci_remove handling to the driver, so it will clean up if
the device is hot-removed.

Signed-off-by: Corey Minyard <minyard@acm.org>

Index: linux-2.6.19/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.19.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6.19/drivers/char/ipmi/ipmi_si_intf.c
@@ -2191,12 +2191,15 @@ static int __devinit ipmi_pci_probe(stru
 		info->irq_setup = std_irq_setup;
 
 	info->dev = &pdev->dev;
+	pdev->dev->driver_data = info;
 
 	return try_smi_init(info);
 }
 
 static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
 {
+	struct smi_info *info = pdev->dev->driver_data;
+	cleanup_one_si(info);
 }
 
 #ifdef CONFIG_PM

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

* Re: [patch 3/4] ipmi: add pci remove handling
  2007-02-14 20:06 [patch 3/4] ipmi: add pci remove handling Corey Minyard
@ 2007-02-15 10:27 ` Andrew Morton
  2007-02-15 15:53   ` Corey Minyard
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2007-02-15 10:27 UTC (permalink / raw)
  To: minyard; +Cc: Linux Kernel

On Wed, 14 Feb 2007 14:06:24 -0600 Corey Minyard <minyard@acm.org> wrote:

> Add pci_remove handling to the driver, so it will clean up if
> the device is hot-removed.
> 
> Signed-off-by: Corey Minyard <minyard@acm.org>
> 
> Index: linux-2.6.19/drivers/char/ipmi/ipmi_si_intf.c
> ===================================================================
> --- linux-2.6.19.orig/drivers/char/ipmi/ipmi_si_intf.c
> +++ linux-2.6.19/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2191,12 +2191,15 @@ static int __devinit ipmi_pci_probe(stru
>  		info->irq_setup = std_irq_setup;
>  
>  	info->dev = &pdev->dev;
> +	pdev->dev->driver_data = info;
>  
>  	return try_smi_init(info);
>  }
>  
>  static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
>  {
> +	struct smi_info *info = pdev->dev->driver_data;
> +	cleanup_one_si(info);
>  }

drivers/char/ipmi/ipmi_si_intf.c: In function 'ipmi_pci_probe':
drivers/char/ipmi/ipmi_si_intf.c:2192: error: invalid type argument of '->'
drivers/char/ipmi/ipmi_si_intf.c: In function 'ipmi_pci_remove':
drivers/char/ipmi/ipmi_si_intf.c:2199: error: invalid type argument of '->'

Judging from the patch headers you were working against 2.6.19, which is
most optimistic.  Please always prepare and test patches against the
latest kernel.

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

* Re: [patch 3/4] ipmi: add pci remove handling
  2007-02-15 10:27 ` Andrew Morton
@ 2007-02-15 15:53   ` Corey Minyard
  2007-02-16 13:16     ` Rolf Eike Beer
  0 siblings, 1 reply; 5+ messages in thread
From: Corey Minyard @ 2007-02-15 15:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel

On Thu, Feb 15, 2007 at 02:27:45AM -0800, Andrew Morton wrote:
> 
> Judging from the patch headers you were working against 2.6.19, which is
> most optimistic.  Please always prepare and test patches against the
> latest kernel.

Well, I had it applied against a 2.6.20 kernel, but I messed up the
testing of it.  Sorry, my bad.

New patch...


Add pci_remove handling to the driver, so it will clean up if
the device is hot-removed.

Signed-off-by: Corey Minyard <minyard@acm.org>

Index: linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.20.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
@@ -2191,12 +2191,15 @@ static int __devinit ipmi_pci_probe(stru
 		info->irq_setup = std_irq_setup;
 
 	info->dev = &pdev->dev;
+	pdev->dev.driver_data = info;
 
 	return try_smi_init(info);
 }
 
 static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
 {
+	struct smi_info *info = pdev->dev.driver_data;
+	cleanup_one_si(info);
 }
 
 #ifdef CONFIG_PM

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

* Re: [patch 3/4] ipmi: add pci remove handling
  2007-02-15 15:53   ` Corey Minyard
@ 2007-02-16 13:16     ` Rolf Eike Beer
  2007-02-16 16:13       ` Corey Minyard
  0 siblings, 1 reply; 5+ messages in thread
From: Rolf Eike Beer @ 2007-02-16 13:16 UTC (permalink / raw)
  To: minyard; +Cc: Andrew Morton, Linux Kernel

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

Am Donnerstag, 15. Februar 2007 schrieb Corey Minyard:
> On Thu, Feb 15, 2007 at 02:27:45AM -0800, Andrew Morton wrote:
> > Judging from the patch headers you were working against 2.6.19, which is
> > most optimistic.  Please always prepare and test patches against the
> > latest kernel.
>
> Well, I had it applied against a 2.6.20 kernel, but I messed up the
> testing of it.  Sorry, my bad.
>
> New patch...
>
>
> Add pci_remove handling to the driver, so it will clean up if
> the device is hot-removed.
>
> Signed-off-by: Corey Minyard <minyard@acm.org>
>
> Index: linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
> ===================================================================
> --- linux-2.6.20.orig/drivers/char/ipmi/ipmi_si_intf.c
> +++ linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2191,12 +2191,15 @@ static int __devinit ipmi_pci_probe(stru
>  		info->irq_setup = std_irq_setup;
>
>  	info->dev = &pdev->dev;
> +	pdev->dev.driver_data = info;
>
>  	return try_smi_init(info);
>  }
>
>  static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
>  {
> +	struct smi_info *info = pdev->dev.driver_data;
> +	cleanup_one_si(info);
>  }

Please use pci_{set,get}_drvdata() to access this field.

Greetings,

Eike

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [patch 3/4] ipmi: add pci remove handling
  2007-02-16 13:16     ` Rolf Eike Beer
@ 2007-02-16 16:13       ` Corey Minyard
  0 siblings, 0 replies; 5+ messages in thread
From: Corey Minyard @ 2007-02-16 16:13 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: Andrew Morton, Linux Kernel

On Fri, Feb 16, 2007 at 02:16:17PM +0100, Rolf Eike Beer wrote:
> 
> Please use pci_{set,get}_drvdata() to access this field.
> 
> Greetings,
> 
> Eike

Yes, much better.  Thanks.  One more time...


Add pci_remove handling to the driver, so it will clean up if
the device is hot-removed.

Signed-off-by: Corey Minyard <minyard@acm.org>

Index: linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.20.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6.20/drivers/char/ipmi/ipmi_si_intf.c
@@ -2191,12 +2191,15 @@ static int __devinit ipmi_pci_probe(stru
 		info->irq_setup = std_irq_setup;
 
 	info->dev = &pdev->dev;
+	pci_set_drvdata(pdev, info);
 
 	return try_smi_init(info);
 }
 
 static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
 {
+	struct smi_info *info = pci_get_drvdata(pdev);
+	cleanup_one_si(info);
 }
 
 #ifdef CONFIG_PM

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

end of thread, other threads:[~2007-02-16 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 20:06 [patch 3/4] ipmi: add pci remove handling Corey Minyard
2007-02-15 10:27 ` Andrew Morton
2007-02-15 15:53   ` Corey Minyard
2007-02-16 13:16     ` Rolf Eike Beer
2007-02-16 16:13       ` Corey Minyard

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