linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Vitor Soares <vitor.soares@synopsys.com>
Cc: linux-iio@vger.kernel.org, linux-i3c@lists.infradead.org,
	linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, lars@metafoo.de,
	knaack.h@gmx.de, jic23@kernel.org, lorenzo.bianconi83@gmail.com,
	bbrezillon@kernel.org, rafael@kernel.org,
	gregkh@linuxfoundation.org, broonie@kernel.org,
	joao.pinto@synopsys.com
Subject: Re: [PATCH 2/3] i3c: Add i3c_get_device_id helper
Date: Tue, 16 Apr 2019 08:18:25 +0200	[thread overview]
Message-ID: <20190416081825.2d17b771@collabora.com> (raw)
In-Reply-To: <33ba7e13816fcece0a2f7ec917c18807359c16c7.1555354268.git.vitor.soares@synopsys.com>

On Mon, 15 Apr 2019 21:19:40 +0200
Vitor Soares <vitor.soares@synopsys.com> wrote:

> This helper return the i3c_device_id structure in order the client
> have access to the driver data.
> 
> Signed-off-by: Vitor Soares <vitor.soares@synopsys.com>
> ---
>  drivers/i3c/device.c       | 8 ++++++++
>  include/linux/i3c/device.h | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
> index 472be99..8ab8e4c 100644
> --- a/drivers/i3c/device.c
> +++ b/drivers/i3c/device.c
> @@ -235,6 +235,14 @@ struct i3c_device *dev_to_i3cdev(struct device *dev)
>  }
>  EXPORT_SYMBOL_GPL(dev_to_i3cdev);
>  
> +const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev)
> +{
> +	const struct i3c_driver *i3cdrv = drv_to_i3cdrv(i3cdev->dev.driver);
> +
> +	return i3cdrv->id_table;
> +}
> +EXPORT_SYMBOL_GPL(i3c_get_device_id);

I think what you want is i3c_device_match_id(). Just move the function
to drivers/i3c/device.c, export it and define its prototype in
include/i3c/device.h.

> +
>  /**
>   * i3c_driver_register_with_owner() - register an I3C device driver
>   *
> diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
> index 7ee7e30..ee48886 100644
> --- a/include/linux/i3c/device.h
> +++ b/include/linux/i3c/device.h
> @@ -211,6 +211,7 @@ static inline struct i3c_driver *drv_to_i3cdrv(struct device_driver *drv)
>  
>  struct device *i3cdev_to_dev(struct i3c_device *i3cdev);
>  struct i3c_device *dev_to_i3cdev(struct device *dev);
> +const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev);
>  
>  static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,
>  				      void *data)


  reply	other threads:[~2019-04-16  6:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 19:19 [PATCH 0/3] Add ST lsm6dso i3c suppport Vitor Soares
2019-04-15 19:19 ` [PATCH 1/3] remap: Add I3C bus support Vitor Soares
2019-04-16  6:15   ` Boris Brezillon
2019-04-16 14:41     ` Vitor Soares
2019-04-16 15:39   ` Mark Brown
2019-04-23 14:58     ` Vitor Soares
2019-04-23 15:14       ` Boris Brezillon
2019-04-23 15:55         ` Vitor Soares
2019-04-15 19:19 ` [PATCH 2/3] i3c: Add i3c_get_device_id helper Vitor Soares
2019-04-16  6:18   ` Boris Brezillon [this message]
2019-04-16 14:48     ` Vitor Soares
2019-04-15 19:19 ` [PATCH 3/3] iio: imu: st_lsm6dsx: Add i3c basic support Vitor Soares
2019-04-15 22:17   ` Lorenzo Bianconi
2019-04-16 13:53     ` Vitor Soares
2019-04-16  6:25   ` Boris Brezillon
2019-04-16  7:58     ` Lorenzo Bianconi
2019-04-16  8:05       ` Boris Brezillon
2019-04-16 15:00         ` Vitor Soares
2019-04-16 15:02     ` Vitor Soares
2019-04-16  6:32 ` [PATCH 0/3] Add ST lsm6dso i3c suppport Boris Brezillon

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=20190416081825.2d17b771@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=bbrezillon@kernel.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=joao.pinto@synopsys.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=pmeerw@pmeerw.net \
    --cc=rafael@kernel.org \
    --cc=vitor.soares@synopsys.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).