Re: [PATCH v5 07/11] Bluetooth: hci_qca: Embed bt_power in struct qca_serdev
Dmitry Baryshkov <[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 | <oha2k2z4gts52xjrmjsquqbhikbyfrequxuuwpqx4pjcdiwuqj@3u3wvmkeivkp> |
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? -- With best wishes Dmitry