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

Hi Boris,

From: Boris Brezillon <boris.brezillon@collabora.com>
Date: Tue, Apr 16, 2019 at 07:18:25

> 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(). 

I want the i3c_device_id struct of an i3c_device. What is the name that 
you suggest?

>Just move the function
> to drivers/i3c/device.c, export it and define its prototype in
> include/i3c/device.h.

You are right, this should go for the device side.

> 
> > +
> >  /**
> >   * 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)

Best regards,
Vitor Soares

_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

Thread overview: 19+ 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
     [not found]   ` <20190416153948.GF4834@sirena.org.uk>
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
2019-04-16 14:48     ` Vitor Soares [this message]
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=13D59CF9CEBAF94592A12E8AE55501350A6159AD@DE02WEMBXB.internal.synopsys.com \
    --to=vitor.soares@synopsys.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --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 \
    /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).