2010-04-05 23:04:32

by Ben Dooks

[permalink] [raw]
Subject: Re: [PATCH 33/37] sound/soc: use .dev.of_node instead of .node in struct of_device

On Thu, Mar 11, 2010 at 11:06:50AM -0700, Grant Likely wrote:
> .node is being removed
>
> Signed-off-by: Grant Likely <[email protected]>
> ---
>
> sound/soc/fsl/mpc8610_hpcd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
> index ef67d1c..d7e1b9a 100644
> --- a/sound/soc/fsl/mpc8610_hpcd.c
> +++ b/sound/soc/fsl/mpc8610_hpcd.c
> @@ -202,7 +202,7 @@ static struct snd_soc_ops mpc8610_hpcd_ops = {
> static int mpc8610_hpcd_probe(struct of_device *ofdev,
> const struct of_device_id *match)
> {
> - struct device_node *np = ofdev->node;
> + struct device_node *np = ofdev->dev.of_node;
> struct device_node *codec_np = NULL;
> struct device_node *guts_np = NULL;
> struct device_node *dma_np = NULL;

This looks like one case where an inline function would have been a
help.


--
Ben ([email protected], http://www.fluff.org/)

'a smiley only costs 4 bytes'


2010-04-05 23:48:13

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH 33/37] sound/soc: use .dev.of_node instead of .node in struct of_device

Hi Ben, thanks for the comment. Reply below...

On Mon, Apr 5, 2010 at 5:03 PM, Ben Dooks <[email protected]> wrote:
> On Thu, Mar 11, 2010 at 11:06:50AM -0700, Grant Likely wrote:
>> .node is being removed
[...]
>> --- a/sound/soc/fsl/mpc8610_hpcd.c
>> +++ b/sound/soc/fsl/mpc8610_hpcd.c
>> @@ -202,7 +202,7 @@ static struct snd_soc_ops mpc8610_hpcd_ops = {
>> ?static int mpc8610_hpcd_probe(struct of_device *ofdev,
>> ? ? ? const struct of_device_id *match)
>> ?{
>> - ? ? struct device_node *np = ofdev->node;
>> + ? ? struct device_node *np = ofdev->dev.of_node;
>> ? ? ? struct device_node *codec_np = NULL;
>> ? ? ? struct device_node *guts_np = NULL;
>> ? ? ? struct device_node *dma_np = NULL;
>
> This looks like one case where an inline function would have been a
> help.

In what regard (how would you like it to look)? The node pointer
location is very unlikely to move again, and I prefer the clarity of
direct dereferencing.

g.