All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Rob Herring <robh@kernel.org>, Johan Hovold <johan@kernel.org>
Subject: [PATCH 10/19] file2alias: Support for serdev devices
Date: Tue, 29 May 2018 15:10:05 +0200	[thread overview]
Message-ID: <20180529131014.18641-11-ricardo.ribalda@gmail.com> (raw)
In-Reply-To: <20180529131014.18641-1-ricardo.ribalda@gmail.com>

This patch allows file2alias to generate the proper module headers to
support serdev modalias drivers.

Eg:

root@qt5022:~# modinfo serdev:ttydev | grep alias
alias:          serdev:ttydev_serdev
alias:          serdev:ttydev

root@qt5022:~#
	cat /lib/modules/4.16.0-qtec-standard/modules.alias | grep serdev
alias serdev:ttydev_serdev serdev_ttydev
alias serdev:ttydev serdev_ttydev

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 scripts/mod/devicetable-offsets.c |  3 +++
 scripts/mod/file2alias.c          | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 9fad6afe4c41..6082c41b7ad7 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -142,6 +142,9 @@ int main(void)
 	DEVID(i2c_device_id);
 	DEVID_FIELD(i2c_device_id, name);
 
+	DEVID(serdev_device_id);
+	DEVID_FIELD(serdev_device_id, name);
+
 	DEVID(spi_device_id);
 	DEVID_FIELD(spi_device_id, name);
 
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index b9beeaa4695b..dce6df3a159a 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -955,6 +955,17 @@ static int do_i2c_entry(const char *filename, void *symval,
 }
 ADD_TO_DEVTABLE("i2c", i2c_device_id, do_i2c_entry);
 
+/* Looks like: serdev:S */
+static int do_serdev_entry(const char *filename, void *symval,
+			   char *alias)
+{
+	DEF_FIELD_ADDR(symval, serdev_device_id, name);
+	sprintf(alias, SERDEV_MODULE_PREFIX "%s", *name);
+
+	return 1;
+}
+ADD_TO_DEVTABLE("serdev", serdev_device_id, do_serdev_entry);
+
 /* Looks like: spi:S */
 static int do_spi_entry(const char *filename, void *symval,
 			char *alias)
-- 
2.17.0

  parent reply	other threads:[~2018-05-29 13:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 13:09 [PATCH 00/19] Dynamically load/remove serdev devices via sysfs* Ricardo Ribalda Delgado
2018-05-29 13:09 ` [PATCH 01/19] serdev: Add id_table to serdev_device_driver Ricardo Ribalda Delgado
2018-05-29 13:09 ` [PATCH 02/19] Bluetooth: hci_bcm: Add serdev_id_table Ricardo Ribalda Delgado
2018-05-29 13:09 ` [PATCH 03/19] Bluetooth: hci_ll: " Ricardo Ribalda Delgado
2018-05-29 13:09 ` [PATCH 04/19] Bluetooth: hci_nokia: " Ricardo Ribalda Delgado
2018-06-05 13:36   ` Andy Shevchenko
2018-06-05 13:53   ` Marcel Holtmann
2018-06-07 10:27     ` Pavel Machek
2018-06-07 12:32       ` Marcel Holtmann
2018-06-07 12:51         ` Pavel Machek
2018-05-29 13:10 ` [PATCH 05/19] serdev: Introduce modalias field Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 06/19] serdev: Support bus matching with " Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 07/19] serdev: Allows dynamic creation of devices via sysfs Ricardo Ribalda Delgado
2018-05-29 15:38   ` Rob Herring
2018-05-29 16:30     ` Ricardo Ribalda Delgado
2018-05-29 16:32       ` Ricardo Ribalda Delgado
2018-05-29 20:35   ` Andy Shevchenko
2018-05-29 21:23     ` Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 08/19] serdev: Provide modalias attribute for modalias devices Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 09/19] serdev: Provide modalias uevent " Ricardo Ribalda Delgado
2018-05-29 13:10 ` Ricardo Ribalda Delgado [this message]
2018-05-29 13:10 ` [PATCH 11/19] Bluetooth: hci_bcm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 12/19] Bluetooth: hci_ll: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 13/19] Bluetooth: hci_nokia: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 14/19] mfd: rave-sp: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 15/19] net: qualcomm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-01  8:59   ` Stefan Wahren
2018-05-29 13:10 ` [PATCH 16/19] serdev: ttyport: Move serport structure to its own header Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 17/19] serdev: Mark controllers compatible with ttyport Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 18/19] serdev: ttydev: Serdev driver that creates an standard TTY port Ricardo Ribalda Delgado
2018-06-05 13:42   ` Andy Shevchenko
2018-06-06  6:58     ` Ricardo Ribalda Delgado
2018-06-06  7:47       ` Ricardo Ribalda Delgado
2018-06-06  9:55         ` Andy Shevchenko
2018-06-06  9:58           ` Ricardo Ribalda Delgado
2018-05-29 13:10 ` [PATCH 19/19] serdev: Instantiate a ttydev serdev if acpi and of fails Ricardo Ribalda Delgado
2018-06-05 13:44   ` Andy Shevchenko
2018-06-06  7:28     ` Ricardo Ribalda Delgado

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=20180529131014.18641-11-ricardo.ribalda@gmail.com \
    --to=ricardo.ribalda@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=robh@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.