Re: [PATCH v5 07/11] Bluetooth: hci_qca: Embed bt_power in struct qca_serdev
Loic Poulain <[email protected]>
| Newsgroups | org.kernel.vger.linux-bluetooth,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <CAFEp6-2_ah4D2ZvkvwN2hYaJ9adYT7i3Rr9WPMLUXtzk984Htg@mail.gmail.com> |
On Wed, Jul 22, 2026 at 3:19 PM Dmitry Baryshkov <[email protected]> wrote: > > On Mon, Jul 20, 2026 at 10:04:09AM +0200, Loic Poulain wrote: > > 'bt_power' is allocated dynamically only for a subset of SOC types, using a > > switch on the SOC type that mirrors the one that follows it. This is about > > to become pointless as the power sequencer path (used by M.2 modules) is > > independent of the SOC type and needs 'bt_power' populated for any type. > > > > Embed 'struct qca_power' directly in 'struct qca_serdev' instead of > > allocating it separately. This drops the extra allocation and its dedicated > > SOC-type switch, and removes the need for NULL checks on the pointer. > > > > No functional change intended. > > > > Reviewed-by: Bartosz Golaszewski <[email protected]> > > Signed-off-by: Loic Poulain <[email protected]> > > --- > > drivers/bluetooth/hci_qca.c | 72 ++++++++++++++++----------------------------- > > 1 file changed, 26 insertions(+), 46 deletions(-) > > > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > > index 81fa41915363ce577ad7c6f25fe1b0a69536d462..7e4cb03d3db0722e5f9fa2e7a5a9a0894bf4f18c 100644 > > --- a/drivers/bluetooth/hci_qca.c > > +++ b/drivers/bluetooth/hci_qca.c > > @@ -226,7 +226,7 @@ struct qca_serdev { > > struct gpio_desc *sw_ctrl; > > struct clk *susclk; > > enum qca_btsoc_type btsoc_type; > > - struct qca_power *bt_power; > > + struct qca_power bt_power; > > Can we drop it completely, putting necessary fields directly to > qca_serdev? qca_power groups the power-related resources together which makes some sense I think. I don't mind moving the fields into struct qca_serdev, and that's a straightforward change, but I'd prefer to address that in a follow-up cleanup rather than here, unless you see it as a requirement for this series. Regards, Loic