alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robert Moore <robert.moore@intel.com>,
	Lv Zheng <lv.zheng@intel.com>,
	"Rafael J.Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <lenb@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-acpi@vger.kernel.org,
	devel@acpica.org, linux-kernel@vger.kernel.org,
	Support Opensource <support.opensource@diasemi.com>,
	Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>,
	Suthikulpanit@diasemi.com,
	Suravee <Suravee.Suthikulpanit@amd.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Hanjun Guo <hanjun.guo@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v2 2/2] ASoC: da7219: Convert driver to use generic device/fwnode functions
Date: Thu, 19 May 2016 16:27:31 +0300	[thread overview]
Message-ID: <1463664451.31269.3.camel@linux.intel.com> (raw)
In-Reply-To: <eea79e2c26dafa785451931387cfce716bd150d4.1463477116.git.Adam.Thomson.Opensource@diasemi.com>

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@diasemi.com>
> Tested-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.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@linux.intel.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-05-19 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 10:28 [PATCH 0/2] ASoC: da7219: Convert driver to use generic FW functions Adam Thomson
2016-05-17 10:28 ` [PATCH 1/2] device property: Add function to search for named child of device Adam Thomson
2016-05-17 10:28 ` [PATCH v2 2/2] ASoC: da7219: Convert driver to use generic device/fwnode functions Adam Thomson
2016-05-19 13:27   ` Andy Shevchenko [this message]
2016-05-23 22:53     ` Opensource [Adam Thomson]
2016-05-24 10:53       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463664451.31269.3.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=Suthikulpanit@diasemi.com \
    --cc=akpm@linux-foundation.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bhelgaas@google.com \
    --cc=broonie@kernel.org \
    --cc=devel@acpica.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hanjun.guo@linaro.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=perex@perex.cz \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=support.opensource@diasemi.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).