Re: [PATCH v2 08/35] brcmfmac: of: Fetch Apple properties

From: Andy Shevchenko
Date: Tue Jan 04 2022 - 06:19:12 EST


On Tue, Jan 4, 2022 at 9:28 AM Hector Martin <marcan@xxxxxxxxx> wrote:
>
> On Apple ARM64 platforms, firmware selection requires two properties
> that come from system firmware: the module-instance (aka "island", a
> codename representing a given hardware platform) and the antenna-sku.
> We map Apple's module codenames to board_types in the form
> "apple,<module-instance>".
>
> The mapped board_type is added to the DTS file in that form, while the
> antenna-sku is forwarded by our bootloader from the Apple Device Tree
> into the FDT. Grab them from the DT so firmware selection can use
> them.

> + /* Apple ARM64 platforms have their own idea of board type, passed in
> + * via the device tree. They also have an antenna SKU parameter
> + */
> + if (!of_property_read_string(np, "brcm,board-type", &prop))
> + settings->board_type = devm_kstrdup(dev, prop, GFP_KERNEL);
> +
> + if (!of_property_read_string(np, "apple,antenna-sku", &prop))
> + settings->antenna_sku = devm_kstrdup(dev, prop, GFP_KERNEL);

No error checks?
But hold on, why do you need to copy them? Are you expecting this to be in DTO?

--
With Best Regards,
Andy Shevchenko