lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 8 Aug 2022 17:05:25 +0100 From: Lee Jones <lee.jones@...aro.org> To: Jerome Neanne <jneanne@...libre.com> Cc: lgirdwood@...il.com, broonie@...nel.org, robh+dt@...nel.org, nm@...com, kristo@...nel.org, khilman@...libre.com, narmstrong@...libre.com, msp@...libre.com, j-keerthy@...com, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, Lee Jones <lee@...nel.org> Subject: Re: [PATCH v2 08/11] mfd: tps65219: Add power-button support On Tue, 26 Jul 2022, Jerome Neanne wrote: > From: Markus Schneider-Pargmann <msp@...libre.com> > > Using a power-button on the EN/PB/VSENSE pin of TPS65219 is optional, so > this driver adds the mfd cell for tps65219-pwrbutton only if needed. Two > interrupts are passed to the driver. Power button support was already added in the previous patch. > Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com> > Signed-off-by: Jerome Neanne <jneanne@...libre.com> > --- > drivers/mfd/tps65219.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c > index 7366f251c21d..e1c30a49bf08 100644 > --- a/drivers/mfd/tps65219.c > +++ b/drivers/mfd/tps65219.c > @@ -335,7 +335,10 @@ static int tps65219_probe(struct i2c_client *client, > struct tps65219 *tps; > int ret; > unsigned int chipid; > + bool pwr_button; > bool sys_pwr; > + struct mfd_cell cells[TPS65219_MAX_CELLS]; > + int nr_cells = 0; > > tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); > if (!tps) > @@ -364,9 +367,16 @@ static int tps65219_probe(struct i2c_client *client, > return ret; > } > > - ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65219_cells, > - ARRAY_SIZE(tps65219_cells), NULL, 0, > - NULL); > + memcpy(&cells[nr_cells++], &tps65219_regulator_cell, > + sizeof(tps65219_regulator_cell)); > + pwr_button = of_property_read_bool(tps->dev->of_node, "power-button"); > + if (pwr_button) > + memcpy(&cells[nr_cells++], &tps65219_pwrbutton_cell, > + sizeof(tps65219_pwrbutton_cell)); Gross, no way. Please call devm_mfd_add_devices() twice. > + ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, cells, > + nr_cells, NULL, 0, > + regmap_irq_get_domain(tps->irq_data)); > if (ret) { > dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret); > return ret; -- DEPRECATED: Please use lee@...nel.org
Powered by blists - more mailing lists