pinctrl: tangier: simplify locking using cleanup helpers
PATCH 1/1 pinctrl: tangier: simplify locking using cleanup helpers
Use lock guards from cleanup.h to simplify locking.
--- drivers/pinctrl/intel/pinctrl-tangier.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/pinctrl/intel/pinctrl-tangier.c +7 -9
@@ -9,6 +9,7 @@*/ #include <linux/bits.h> +#include <linux/cleanup.h> #include <linux/device.h> #include <linux/err.h> #include <linux/errno.h>
@@ -220,7 +221,6 @@ static int tng_pinmux_set_mux(struct pinctrl_dev *pctldev,const struct intel_pingroup *grp = &tp->groups[group];u32 bits = grp->mode <<BUFCFG_PINMODE_SHIFT ;u32 mask =BUFCFG_PINMODE_MASK ; -unsigned long flags;unsigned int i;/*
@@ -232,11 +232,11 @@ static int tng_pinmux_set_mux(struct pinctrl_dev *pctldev,return -EBUSY ; } +guard (raw_spinlock_irqsave)(&tp->lock); +/* Now enable the mux setting for each pin in the group */ -raw_spin_lock_irqsave (&tp->lock, flags);for (i =0 ; i < grp->grp.npins; i++)tng_update_bufcfg (tp, grp->grp.pins[i], bits, mask); -raw_spin_unlock_irqrestore (&tp->lock, flags);return 0 ; }
@@ -248,14 +248,13 @@ static int tng_gpio_request_enable(struct pinctrl_dev *pctldev,struct tng_pinctrl *tp =pinctrl_dev_get_drvdata (pctldev);u32 bits =BUFCFG_PINMODE_GPIO <<BUFCFG_PINMODE_SHIFT ;u32 mask =BUFCFG_PINMODE_MASK ; -unsigned long flags;if (!tng_buf_available (tp, pin))return -EBUSY ; -raw_spin_lock_irqsave (&tp->lock, flags); +guard (raw_spinlock_irqsave)(&tp->lock); +tng_update_bufcfg (tp, pin, bits, mask); -raw_spin_unlock_irqrestore (&tp->lock, flags);return 0 ; }
@@ -360,7 +359,6 @@ static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin,unsigned int param =pinconf_to_config_param (config);unsigned int arg =pinconf_to_config_argument (config);u32 mask, term, value =0 ; -unsigned long flags;switch (param) {case PIN_CONFIG_BIAS_DISABLE :
@@ -432,9 +430,9 @@ static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin,return -EINVAL ; } -raw_spin_lock_irqsave (&tp->lock, flags); +guard (raw_spinlock_irqsave)(&tp->lock); +tng_update_bufcfg (tp, pin, value, mask); -raw_spin_unlock_irqrestore (&tp->lock, flags);return 0 ; }
base-commit: e58e519b80ba79cd73abb1d631d429b7322ac9cb
Signature · 1 line
2.17.1
Quoted 3 lines · Raag Jadav
Use lock guards from
cleanup.hto simplify locking.Signed-off-by Raag Jadav <[email protected]>
Quoted 6 lines · Mika Westerberg
Quoted 3 lines · Raag Jadav
Use lock guards from
cleanup.hto simplify locking.Signed-off-by Raag Jadav <[email protected]>Acked-by Mika Westerberg <[email protected]>
Pushed to my review and testing queue, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Mika Westerberg
Quoted 3 lines · Raag Jadav
Use lock guards from
cleanup.hto simplify locking.Signed-off-by Raag Jadav <[email protected]>Acked-by Mika Westerberg <[email protected]>Pushed to my review and testing queue, thanks!
Awesome, I noticed a few commits having duplicate Acks in Intel tree.
Raag
Quoted 5 lines · Raag Jadav
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Mika Westerberg
Quoted 2 lines · Raag Jadav
Use lock guards from
cleanup.hto simplify locking.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Raag Jadav <[email protected]>Acked-by Mika Westerberg <[email protected]>Pushed to my review and testing queue, thanks!
Awesome, I noticed a few commits having duplicate Acks in Intel tree.
You are right, I have mistakenly run a msg-filter before applying my byt series. Thanks for spotting this, now should be fixed!
Signature · 2 lines
With Best Regards, Andy Shevchenko