Re: linux-next: block/proc tree build failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Mar 2009, Alexey Dobriyan wrote:
> On Wed, Mar 11, 2009 at 10:44:18PM +1100, Stephen Rothwell wrote:
> > --- a/drivers/block/ps3vram.c
> > +++ b/drivers/block/ps3vram.c
> > @@ -552,7 +552,6 @@ static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
> >  		return;
> >  	}
> >  
> > -	pde->owner = THIS_MODULE;
> >  	pde->data = priv;
> 
> Geert, driver should use proc_create_data() as well, and ->owner wasn't
> necessary in the first place.

Thanks! So here's a replacement patch:

commit 077f72d323360f112aaf41a75307dc2a284176a7
Author: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>
Date:   Thu Mar 12 14:19:12 2009 +0100

    ps3vram: Use proc_create_data() instead of proc_create()
    
    Use proc_create_data() to avoid race conditions, and kill the unnecessary
    setting of ->owner (this field is already gone in linux-next)
    
    Reported-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
    Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 271f137..6e73868 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -546,14 +546,10 @@ static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
 	struct ps3vram_priv *priv = dev->core.driver_data;
 	struct proc_dir_entry *pde;
 
-	pde = proc_create(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops);
-	if (!pde) {
+	pde = proc_create_data(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops,
+			       priv);
+	if (!pde)
 		dev_warn(&dev->core, "failed to create /proc entry\n");
-		return;
-	}
-
-	pde->owner = THIS_MODULE;
-	pde->data = priv;
 }
 
 static int ps3vram_make_request(struct request_queue *q, struct bio *bio)

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@xxxxxxxxxxx
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux