public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Tejun Heo <tj@kernel.org>, Jean Delvare <khali@linux-fr.org>
Subject: Re: [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly
Date: Mon, 2 Aug 2010 12:04:56 +0200	[thread overview]
Message-ID: <20100802100455.GC3334@sortiz-mobl> (raw)
In-Reply-To: <1280740459-11500-2-git-send-email-u.kleine-koenig@pengutronix.de>

Hi Uwe,

On Mon, Aug 02, 2010 at 11:14:18AM +0200, Uwe Kleine-König wrote:
> There is a shiny new mc13783 API function that can be used instead.
> 
> While at it refactor the code a bit to reduce code duplication a bit.
> 
> This removes the last user of <linux/mfd/mc13783-private.h> and so this
> include file can go away.
That's correct, patch applied.
As I said, we can now move mc13783-private.h to drivers/mfd/

Cheers,
Samuel.


> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/hwmon/mc13783-adc.c |   17 +++++++++++++----
>  1 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
> index ce3c7bc..d5226c9 100644
> --- a/drivers/hwmon/mc13783-adc.c
> +++ b/drivers/hwmon/mc13783-adc.c
> @@ -18,7 +18,7 @@
>   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#include <linux/mfd/mc13783-private.h>
> +#include <linux/mfd/mc13783.h>
>  #include <linux/platform_device.h>
>  #include <linux/hwmon-sysfs.h>
>  #include <linux/kernel.h>
> @@ -144,6 +144,14 @@ static const struct attribute_group mc13783_group_ts = {
>  	.attrs = mc13783_attr_ts,
>  };
>  
> +static int mc13783_adc_use_touchscreen(struct platform_device *pdev)
> +{
> +	struct mc13783_adc_priv *priv = platform_get_drvdata(pdev);
> +	unsigned flags = mc13783_get_flags(priv->mc13783);
> +
> +	return flags & MC13783_USE_TOUCHSCREEN;
> +}
> +
>  static int __init mc13783_adc_probe(struct platform_device *pdev)
>  {
>  	struct mc13783_adc_priv *priv;
> @@ -162,10 +170,11 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto out_err_create1;
>  
> -	if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> +	if (!mc13783_adc_use_touchscreen(pdev)) {
>  		ret = sysfs_create_group(&pdev->dev.kobj, &mc13783_group_ts);
>  		if (ret)
>  			goto out_err_create2;
> +	}
>  
>  	priv->hwmon_dev = hwmon_device_register(&pdev->dev);
>  	if (IS_ERR(priv->hwmon_dev)) {
> @@ -180,7 +189,7 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
>  
>  out_err_register:
>  
> -	if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> +	if (!mc13783_adc_use_touchscreen(pdev))
>  		sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
>  out_err_create2:
>  
> @@ -199,7 +208,7 @@ static int __devexit mc13783_adc_remove(struct platform_device *pdev)
>  
>  	hwmon_device_unregister(priv->hwmon_dev);
>  
> -	if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> +	if (!mc13783_adc_use_touchscreen(pdev))
>  		sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
>  
>  	sysfs_remove_group(&pdev->dev.kobj, &mc13783_group);
> -- 
> 1.7.1
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  reply	other threads:[~2010-08-02 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02  9:14 [PATCH 1/2] mfd/mc13783: new function exposing flags Uwe Kleine-König
2010-08-02  9:14 ` [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly Uwe Kleine-König
2010-08-02 10:04   ` Samuel Ortiz [this message]
2010-08-02 12:52     ` Uwe Kleine-König
2010-08-02 13:48     ` [PATCH 3/2] mfd/mc13783: get rid of now unused private header Uwe Kleine-König
2010-08-03 10:10       ` Samuel Ortiz
2010-08-02 10:01 ` [PATCH 1/2] mfd/mc13783: new function exposing flags Samuel Ortiz

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=20100802100455.GC3334@sortiz-mobl \
    --to=sameo@linux.intel.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=hdegoede@redhat.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=tj@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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