* [PATCH 3/3] sound: use dev_set_drvdata
@ 2009-05-17 9:29 Julia Lawall
2009-05-17 17:32 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2009-05-17 9:29 UTC (permalink / raw)
To: timur, alsa-devel, linuxppc-dev, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
Eliminate direct accesses to the driver_data field.
cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
struct device *dev;
expression E;
type T;
@@
- dev->driver_data = (T)E
+ dev_set_drvdata(dev, E)
@@
struct device *dev;
type T;
@@
- (T)dev->driver_data
+ dev_get_drvdata(dev)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
sound/soc/fsl/fsl_ssi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -674,7 +674,7 @@ struct snd_soc_dai *fsl_ssi_create_dai(s
ssi_private->dev = ssi_info->dev;
ssi_private->asynchronous = ssi_info->asynchronous;
- ssi_private->dev->driver_data = fsl_ssi_dai;
+ dev_set_drvdata(ssi_private->dev, fsl_ssi_dai);
/* Initialize the the device_attribute structure */
dev_attr->attr.name = "ssi-stats";
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] sound: use dev_set_drvdata
2009-05-17 9:29 [PATCH 3/3] sound: use dev_set_drvdata Julia Lawall
@ 2009-05-17 17:32 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-05-17 17:32 UTC (permalink / raw)
To: Julia Lawall
Cc: linuxppc-dev, alsa-devel, kernel-janitors, timur, linux-kernel
At Sun, 17 May 2009 11:29:21 +0200 (CEST),
Julia Lawall wrote:
>
> From: Julia Lawall <julia@diku.dk>
>
> Eliminate direct accesses to the driver_data field.
> cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015
>
> The semantic patch that makes this change is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> struct device *dev;
> expression E;
> type T;
> @@
>
> - dev->driver_data = (T)E
> + dev_set_drvdata(dev, E)
>
> @@
> struct device *dev;
> type T;
> @@
>
> - (T)dev->driver_data
> + dev_get_drvdata(dev)
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Applied now. Thanks.
Takashi
>
> ---
> sound/soc/fsl/fsl_ssi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -u -p a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -674,7 +674,7 @@ struct snd_soc_dai *fsl_ssi_create_dai(s
> ssi_private->dev = ssi_info->dev;
> ssi_private->asynchronous = ssi_info->asynchronous;
>
> - ssi_private->dev->driver_data = fsl_ssi_dai;
> + dev_set_drvdata(ssi_private->dev, fsl_ssi_dai);
>
> /* Initialize the the device_attribute structure */
> dev_attr->attr.name = "ssi-stats";
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-17 17:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-17 9:29 [PATCH 3/3] sound: use dev_set_drvdata Julia Lawall
2009-05-17 17:32 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox