[Letux-kernel] [PATCH RFC] bluetooth: add uart h4 devices via serdev/devicetree

Sebastian Reichel sebastian.reichel at collabora.com
Sun Nov 11 03:46:48 CET 2018


Hi,

On Sun, Nov 11, 2018 at 12:20:34AM +0100, Andreas Kemnade wrote:
> This is a first try to be able to use h4 devices specified in
> the devicetree, so you do not need to call hciattach and
> it can be automatically probed.
> 
> Of course, proper devicetree bindings documentation is
> missing. And also you would extend that by regulator/
> enable gpio settings.
> 
> But before proceeding further it should be checked if the
> general way of doing things is right.
> 
> Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
> ---

Patch looks good to me, just one note

>  drivers/bluetooth/hci_h4.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 78 insertions(+)
> 

[...]

> +	return hci_uart_register_device(hu, &h4p);
> +}
> +
> +static void hci_h4_remove(struct serdev_device *serdev)
> +{
> +	struct h4_device *h4dev = serdev_device_get_drvdata(serdev);
> +
> +	hci_uart_unregister_device(&h4dev->hu);
> +}

I suggest to add a patch introducing

devm_hci_uart_register_device()

All existing users of hci_uart_register_device() could use it
(your driver, hci_bcm, hci_h5, hci_ll, hci_nokia and hci_qca)
and all drivers but hci_qca can drop their remove function.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20181111/7ea2ce4c/attachment-0001.asc>


More information about the Letux-kernel mailing list