Message ID | 20250131-gpio-set-array-helper-v1-12-991c8ccb4d6e@baylibre.com |
---|---|
State | New |
Headers | show |
Series | gpiolib: add gpiods_set_array_value_cansleep | expand |
On Fri, Jan 31, 2025 at 10:25 PM David Lechner <dlechner@baylibre.com> wrote: > > Reduce verbosity by using gpiods_set_array_value_cansleep() instead of > gpiods_set_array_value_cansleep(). > > ddata->cmd_gpios->ndescs is validated to be equal to > PHY_MDM6600_NR_CMD_LINES during driver probe, so it will have the same > value as the previously hard-coded argument. ... > static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val) > > values[0] = val; FWIW, side note: this code is (potentially) buggy on BE 64-bit. Same for the rest of similar cases, in case you want to address this...
diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c index 152344e4f7e44de0f8ab1cae6ae01a1f1c5408e9..8243bab6ac3af2ee1394ef743aaad12a19c8ae36 100644 --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -177,9 +177,7 @@ static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val) values[0] = val; - gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES, - ddata->cmd_gpios->desc, - ddata->cmd_gpios->info, values); + gpiods_set_array_value_cansleep(ddata->cmd_gpios, values); } /**
Reduce verbosity by using gpiods_set_array_value_cansleep() instead of gpiods_set_array_value_cansleep(). ddata->cmd_gpios->ndescs is validated to be equal to PHY_MDM6600_NR_CMD_LINES during driver probe, so it will have the same value as the previously hard-coded argument. Signed-off-by: David Lechner <dlechner@baylibre.com> --- drivers/phy/motorola/phy-mapphone-mdm6600.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)