linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] et8ek8: Export OF device ID as module aliases
@ 2017-02-20 20:16 Javier Martinez Canillas
  2017-02-20 21:30 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2017-02-20 20:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Sakari Ailus, Mauro Carvalho Chehab,
	Pavel Machek, linux-media

The I2C core always reports a MODALIAS of the form i2c:<foo> even if the
device was registered via OF, this means that exporting the OF device ID
table device aliases in the module is not needed. But in order to change
how the core reports modaliases to user-space, it's better to export it.

Before this patch:

$ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
alias:          i2c:et8ek8

After this patch:

$ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
alias:          i2c:et8ek8
alias:          of:N*T*Ctoshiba,et8ek8C*
alias:          of:N*T*Ctoshiba,et8ek8

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/media/i2c/et8ek8/et8ek8_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c
index bec4a563a09c..f39f5179dd95 100644
--- a/drivers/media/i2c/et8ek8/et8ek8_driver.c
+++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c
@@ -1485,6 +1485,7 @@ static const struct of_device_id et8ek8_of_table[] = {
 	{ .compatible = "toshiba,et8ek8" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, et8ek8_of_table);
 
 static const struct i2c_device_id et8ek8_id_table[] = {
 	{ ET8EK8_NAME, 0 },
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] et8ek8: Export OF device ID as module aliases
  2017-02-20 20:16 [PATCH] [media] et8ek8: Export OF device ID as module aliases Javier Martinez Canillas
@ 2017-02-20 21:30 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2017-02-20 21:30 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, Mauro Carvalho Chehab, Pavel Machek, linux-media

On Mon, Feb 20, 2017 at 05:16:16PM -0300, Javier Martinez Canillas wrote:
> The I2C core always reports a MODALIAS of the form i2c:<foo> even if the
> device was registered via OF, this means that exporting the OF device ID
> table device aliases in the module is not needed. But in order to change
> how the core reports modaliases to user-space, it's better to export it.
> 
> Before this patch:
> 
> $ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
> alias:          i2c:et8ek8
> 
> After this patch:
> 
> $ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
> alias:          i2c:et8ek8
> alias:          of:N*T*Ctoshiba,et8ek8C*
> alias:          of:N*T*Ctoshiba,et8ek8
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Thanks!

Applied to my tree (for-v4.12 branch).

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-20 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 20:16 [PATCH] [media] et8ek8: Export OF device ID as module aliases Javier Martinez Canillas
2017-02-20 21:30 ` Sakari Ailus

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