Re: [PATCH v4 1/2] Bluetooth: Add device_get_bd_address()

From: Pavel Machek
Date: Mon Oct 22 2018 - 17:07:13 EST


> >> explain to me again why this is useful?
> >
> > The official binding for providing the BD_ADDR through the device tree
> > is the property 'local-bd-address'. device_get_bd_address() provides a
> > common API to retrieve the BD_ADDR instead of requiring BT drivers to
> > use the lower level fwnode_property_read_u8_array(). It also avoids
> > repeating the check for an all zeroes BD_ADDR in multiple drivers.
> >
> >> I am failing to see the benefit if this is not part of the property.h API.
> >
> > My understanding is that the intention of property.h it to provide an
> > API for common property types used by drivers from different
> > subsystems, hence the implementation 'lives' in drivers/base.
> > Obtaining the BD_ADDR is clearly limited to the Bluetooth subsystem,
> > and drivers/base doesn't seem to be the right place for it. It's true,
> > device_get_mac_address() lives in the common property code, but that
> > doesn't necessarily mean it really should be there and we should do
> > the same. I agree with Sakari that the the approach taken by V4L2
> > (drivers/media/v4l2-core/v4l2-fwnode.c) seems more appropriate.
> >
> > That said I wouldn't raise opposition if the maintainers of
> > drivers/base agreed to add device_get_mac_address() there, however so
> > far several recent authors of property.[ch] have raised objections.
> so if this is not in drivers/base/ then what is the point in making each driver do this? If it is a common property, then it can be well handled in the Bluetooth core when setting up the hardware.
> This whole BD_ADDR via DT is stupid anyway. Just so that is clear
> up-front. It has been a total hack and fully relies on boot
> loaders doing too much magic and then using DT to hide this magic.

Can you wrap lines at around 72 characters in the emails?

We do ethernet addresses via DT. I don't know if doing that in
bootloader is a hack or not, but if bootloader is already doing that
for ethernet, bluettoth address in DT kind of makes sense.

(cesky, pictures)

Attachment: signature.asc
Description: Digital signature