Re: [PATCH] block/ps3: remove driver_data direct access of structdevice

From: Geert Uytterhoeven
Date: Tue May 05 2009 - 10:32:25 EST


On Tue, 5 May 2009, Roel Kluin wrote:
> In the near future, the driver core is going to not allow direct access
> to the driver_data pointer in struct device. Instead, the functions
> dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> have been around since the beginning, so are backwards compatible with
> all older kernel versions.
>
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>

Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>

Thanks, I'll add it to my list of ps3* patches for 2.6.31...

> diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
> index 8eddef3..8ecf1e0 100644
> --- a/drivers/block/ps3vram.c
> +++ b/drivers/block/ps3vram.c

> @@ -615,9 +615,9 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
> }
>
> mutex_init(&priv->lock);
> - dev->core.driver_data = priv;
> + dev_set_drvdata(&dev->core, priv);
>
> - priv = dev->core.driver_data;
> + priv = dev_get_drvdata(&dev->core);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This line can actually be removed, while we're at it...

> /* Allocate XDR buffer (1MiB aligned) */
> priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software 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-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/