[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1463664451.31269.3.camel@linux.intel.com>
Date: Thu, 19 May 2016 16:27:31 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Adam Thomson <Adam.Thomson.Opensource@...semi.com>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Robert Moore <robert.moore@...el.com>,
Lv Zheng <lv.zheng@...el.com>,
"Rafael J.Wysocki" <rafael.j.wysocki@...el.com>,
Len Brown <lenb@...nel.org>
Cc: alsa-devel@...a-project.org, linux-acpi@...r.kernel.org,
devel@...ica.org, linux-kernel@...r.kernel.org,
Support Opensource <support.opensource@...semi.com>,
Sathyanarayana Nujella <sathyanarayana.nujella@...el.com>,
Suthikulpanit@...semi.com, Suravee <Suravee.Suthikulpanit@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Hanjun Guo <hanjun.guo@...aro.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v2 2/2] ASoC: da7219: Convert driver to use generic
device/fwnode functions
On Tue, 2016-05-17 at 11:28 +0100, Adam Thomson wrote:
> This change converts the driver from using the of_* functions to using
> the device_* and fwnode_* functions for accssing FW related data.
>
> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
> Tested-by: Sathyanarayana Nujella <sathyanarayana.nujella@...el.com>
@@ -538,97 +538,96 @@ static enum da7219_aad_adc_1bit_rpt
> }
> }
>
> -static struct da7219_aad_pdata *da7219_aad_of_to_pdata(struct
> snd_soc_codec *codec)
> +static struct da7219_aad_pdata *da7219_aad_fw_to_pdata(struct
> snd_soc_codec *codec)
> {
> - struct device_node *np = codec->dev->of_node;
> - struct device_node *aad_np = of_find_node_by_name(np,
> "da7219_aad");
> + struct device *dev = codec->dev;
> + struct i2c_client *i2c = to_i2c_client(dev);
> + struct fwnode_handle *aad_np =
> + device_get_named_child_node(dev, "da7219_aad");
I would suggest to do an assignment below...
> struct da7219_aad_pdata *aad_pdata;
> - const char *of_str;
> - u32 of_val32;
> + const char *fw_str;
> + u32 fw_val32;
>
...right here.
Same amount of LOC, but less difficult to see from where aad_np comes.
> if (!aad_np)
> return NULL;
>
> @@ -769,9 +768,9 @@ int da7219_aad_init(struct snd_soc_codec *codec)
> da7219->aad = da7219_aad;
> da7219_aad->codec = codec;
>
> - /* Handle any DT/platform data */
> - if ((codec->dev->of_node) && (da7219->pdata))
> - da7219->pdata->aad_pdata =
> da7219_aad_of_to_pdata(codec);
> + /* Handle any DT/ACPI/platform data */
> + if ((da7219->pdata) && (!da7219->pdata->aad_pdata))
Redundant parens, twice.
--
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy
Powered by blists - more mailing lists