All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/2] iio:trigger: Use dev_{set,get}_drvdata for private data management
Date: Mon, 25 Mar 2013 21:10:28 +0000	[thread overview]
Message-ID: <5150BD44.9030303@kernel.org> (raw)
In-Reply-To: <1364201906-30884-2-git-send-email-lars@metafoo.de>

On 03/25/2013 08:58 AM, Lars-Peter Clausen wrote:
> Use dev_{set,get}_drvdata for managing private data attached to a trigger
> instead of using a custom field in the iio_trigger struct.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
applied to togreg branch of iio.git
> ---
>  drivers/staging/iio/Documentation/trigger.txt | 3 ---
>  include/linux/iio/trigger.h                   | 6 ++----
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/iio/Documentation/trigger.txt b/drivers/staging/iio/Documentation/trigger.txt
> index 75cc37f..64e2e08 100644
> --- a/drivers/staging/iio/Documentation/trigger.txt
> +++ b/drivers/staging/iio/Documentation/trigger.txt
> @@ -10,9 +10,6 @@ struct iio_trig *trig = iio_trigger_alloc("<trigger format string>", ...);
>  allocates a trigger structure.  The key elements to then fill in within
>  a driver are:
>  
> -trig->private_data
> -	Device specific private data.
> -
>  trig->owner
>  	Typically set to THIS_MODULE. Used to ensure correct
>  	ownership of core allocated resources.
> diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
> index b81948a..3869c52 100644
> --- a/include/linux/iio/trigger.h
> +++ b/include/linux/iio/trigger.h
> @@ -44,7 +44,6 @@ struct iio_trigger_ops {
>   * @id:			[INTERN] unique id number
>   * @name:		[DRIVER] unique name
>   * @dev:		[DRIVER] associated device (if relevant)
> - * @private_data:	[DRIVER] device specific data
>   * @list:		[INTERN] used in maintenance of global trigger list
>   * @alloc_list:		[DRIVER] used for driver specific trigger list
>   * @use_count:		use count for the trigger
> @@ -60,7 +59,6 @@ struct iio_trigger {
>  	const char			*name;
>  	struct device			dev;
>  
> -	void				*private_data;
>  	struct list_head		list;
>  	struct list_head		alloc_list;
>  	int use_count;
> @@ -101,7 +99,7 @@ static inline void iio_trigger_get(struct iio_trigger *trig)
>   */
>  static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data)
>  {
> -	trig->private_data = data;
> +	dev_set_drvdata(&trig->dev, data);
>  }
>  
>  /**
> @@ -112,7 +110,7 @@ static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data)
>   */
>  static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)
>  {
> -	return trig->private_data;
> +	return dev_get_drvdata(&trig->dev);
>  }
>  
>  /**
> 

  reply	other threads:[~2013-03-25 21:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25  8:58 [PATCH 1/2] iio:trigger: Introduce iio_tigger_{set,get}_drvdata Lars-Peter Clausen
2013-03-25  8:58 ` [PATCH 2/2] iio:trigger: Use dev_{set,get}_drvdata for private data management Lars-Peter Clausen
2013-03-25 21:10   ` Jonathan Cameron [this message]
2013-03-25 21:09 ` [PATCH 1/2] iio:trigger: Introduce iio_tigger_{set,get}_drvdata Jonathan Cameron

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=5150BD44.9030303@kernel.org \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.