All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Lee Jones <lee.jones@linaro.org>, Rob Herring <robh@kernel.org>,
	Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH v2 14/24] mfd: rave-sp: MODULE_DEVICE_TABLE(serdev)
Date: Mon, 11 Jun 2018 15:14:46 +0200	[thread overview]
Message-ID: <EBCCCD1F-0F23-4599-8A78-32BBF2DAF746@holtmann.org> (raw)
In-Reply-To: <20180611115240.32606-15-ricardo.ribalda@gmail.com>

Hi Ricardo,

> Export serdev table to the module header, allowing module autoload via
> udev/modprobe.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Johan Hovold <johan@kernel.org>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
> drivers/mfd/rave-sp.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
> index 5c858e784a89..c0ecfbc16dca 100644
> --- a/drivers/mfd/rave-sp.c
> +++ b/drivers/mfd/rave-sp.c
> @@ -694,12 +694,19 @@ static int rave_sp_probe(struct serdev_device *serdev)
> 
> MODULE_DEVICE_TABLE(of, rave_sp_dt_ids);
> 
> +static struct serdev_device_id rave_sp_serdev_id[] = {
> +	{ "rave-sp", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(serdev, rave_sp_serdev_id);
> +
> static struct serdev_device_driver rave_sp_drv = {
> 	.probe			= rave_sp_probe,
> 	.driver = {
> 		.name		= "rave-sp",
> 		.of_match_table	= rave_sp_dt_ids,
> 	},
> +	.id_table = rave_sp_serdev_id,
> };
> module_serdev_device_driver(rave_sp_drv);

so I would actually prefer that we not duplicate the .driver.name in the .id_table. This one for example is non-functional since all supported hardware needs a specific .data entry. It will fail here:

        sp->variant = of_device_get_match_data(dev);                             
        if (!sp->variant)                                                        
                return -ENODEV;

Maybe we focus first on getting the base support for new_device etc. merged and use the Edison Bluetooth platform driver support in hci_bcm.c so we can do a real cleanup there. And then later add broad new_device support. Some of these instances should be just fine with never getting it since they require to many per device quirks to make things functional. A blind search+replace is not going to work.

And things like device_get_match_data() should work as well even if the hardware is listed via serdev_device_id. Drivers that are solely DT centric will need a lot more work before dynamic adding of serdev devices can happen.

Regards

Marcel

  reply	other threads:[~2018-06-11 13:14 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:52 [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs* Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 01/24] serdev: Add id_table to serdev_device_driver Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 02/24] Bluetooth: hci_bcm: Add serdev_id_table Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 03/24] Bluetooth: hci_ll: " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 04/24] Bluetooth: hci_nokia: " Ricardo Ribalda Delgado
2018-06-11 12:56   ` Marcel Holtmann
2018-06-11 13:04     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 05/24] serdev: Introduce modalias field Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 06/24] serdev: Support bus matching with " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 07/24] serdev: Allows dynamic creation of devices via sysfs Ricardo Ribalda Delgado
2018-06-11 12:39   ` Andy Shevchenko
2018-06-11 13:03     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 08/24] serdev: Provide modalias attribute for modalias devices Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 09/24] serdev: Provide modalias uevent " Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 10/24] file2alias: Support for serdev devices Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 11/24] Bluetooth: hci_bcm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 12:59   ` Marcel Holtmann
2018-06-11 13:31     ` Andy Shevchenko
2018-06-11 13:31       ` Andy Shevchenko
2018-06-11 11:52 ` [PATCH v2 12/24] Bluetooth: hci_ll: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 13/24] Bluetooth: hci_nokia: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 14/24] mfd: rave-sp: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 13:14   ` Marcel Holtmann [this message]
2018-06-11 15:18     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 15/24] net: qualcomm: MODULE_DEVICE_TABLE(serdev) Ricardo Ribalda Delgado
2018-06-11 13:01   ` Marcel Holtmann
2018-06-11 15:09     ` Ricardo Ribalda Delgado
2018-06-11 15:28       ` Marcel Holtmann
2018-06-11 15:33         ` Ricardo Ribalda Delgado
2018-06-11 15:52           ` Marcel Holtmann
2018-06-11 16:21             ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 16/24] serdev: ttyport: Move serport structure to its own header Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 17/24] serdev: Mark controllers compatible with ttyport Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 18/24] serdev: ttydev: Serdev driver that creates an standard TTY port Ricardo Ribalda Delgado
2018-06-13  1:20   ` Rob Herring
2018-06-13  6:35     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 19/24] serdev: Instantiate a ttydev serdev if acpi and of fails Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 20/24] serdev: Make match_id accessible by drivers Ricardo Ribalda Delgado
2018-06-11 12:47   ` Andy Shevchenko
2018-06-11 13:10     ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 21/24] rave-sp: Support for variants on modalias drivers Ricardo Ribalda Delgado
2018-06-11 12:54   ` Andy Shevchenko
2018-06-11 13:38     ` Marcel Holtmann
2018-06-11 15:21       ` Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 22/24] serdev: Replace IDA functions with IDR Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 23/24] serdev: get/put controller Ricardo Ribalda Delgado
2018-06-11 11:52 ` [PATCH v2 24/24] serdev: serdev_controller_add_probed_device Ricardo Ribalda Delgado
2018-06-14 10:48 ` [PATCH v2 00/19] Dynamically load/remove serdev devices via sysfs* Johan Hovold
2018-06-14 11:06   ` Ricardo Ribalda Delgado
2018-06-14 11:06     ` Ricardo Ribalda Delgado
2018-06-14 13:33     ` Johan Hovold
2018-06-14 14:06       ` Ricardo Ribalda Delgado
2018-06-14 14:55         ` Johan Hovold
2018-06-14 15:20           ` Ricardo Ribalda Delgado
2018-06-14 15:20             ` Ricardo Ribalda Delgado
2018-06-14 15:47             ` Johan Hovold

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=EBCCCD1F-0F23-4599-8A78-32BBF2DAF746@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=johan@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.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.